Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已阅读框架文档之一,“如果会话中需要大对象,应用程序应将这些对象定义为会话管理器中的瞬态对象”
定义那些大对象瞬态如何不会影响保持大对象在会话中?
会话对象由 Web 容器会话管理器持久化。如果您在会话中存储大型对象,则写入这些对象将花费更多时间。如果将这些对象设置为瞬态对象,则在容器序列化 HttpSession 对象时将不考虑它们。这减少了写出对象所需的时间,以及如果使用一个对象,还可以减少数据库中占用的空间。