会话中的瞬态对象
我读过一份框架文档,“如果会话中需要大对象,应用程序应该在会话管理器中将它们定义为瞬态对象”
定义这些大对象瞬态如何对在会话中保留大对象没有影响?
I have read in one of framework documentation, "If large objects are be required in the session, the application should define these as transient objects in the Session Manager"
How does defining those large object transient will make no impact on keeping large objects in session?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
会话对象由 Web 容器会话管理器保存。如果您在会话中存储大型对象,那么写入这些对象将花费更多时间。如果将这些对象设置为瞬态对象,那么当容器序列化 HttpSession 对象时,它们将不会被考虑。这会减少写出对象所需的时间,并且如果使用对象,也会减少数据库中占用的空间。
The session objects are persisted by the web container session manager. If you store large objects in the session, then it will take more time to write those objects. If you make those objects as transient they will not be considered when the HttpSession object is serialized by the container.This reduces the time it takes to write the object out and also the space occupied in the database if one is used.