开发者

Reference Objects in sessions

开发者 https://www.devze.com 2023-03-05 22:33 出处:网络
if a list of objects are saved in the session, the session gets updated automatically when a new 开发者_JAVA百科object is added to the list due to objects declared as reference types.. why this is not

if a list of objects are saved in the session, the session gets updated automatically when a new 开发者_JAVA百科object is added to the list due to objects declared as reference types.. why this is not the same case when removing an item from the list?


First of all, it depends on session state mode. Your thoughts would be for in-process mode or some other custom mode that would store objects in-memory.

In the other hand, removing an object from session state doesn't mean you killed it. It's just a collection of objects like any other (f.e. List).

Objects are destroyed and removed from memory by Garbage Collector.

You can read more about Garbage Collector in this MSDN article:

  • http://msdn.microsoft.com/en-us/library/ms973837.aspx
0

精彩评论

暂无评论...
验证码 换一张
取 消