您可以在这里快速查找:


 
您的位置: 编程学习 > java教程 > 200505
文章分类

Java技术
2005: 03 04 05 06 07 08
09 10 11 12
2006: 01 02

Asp.net
2005: 07 08 09 10 11 12
2006: 01 02

VB编程
2006: 02

Asp编程
2005: 11 12
2006: 01 02

C++/VC
2005: 10 11 12
2006: 01 02

Delphi
2005: 12
2006: 01 02

其它

 本文章适合所有读者

Best Practice 2 Release HttpSessions when finished

corner

 Best Practice 2 Release HttpSessions when finished

HttpSession都生存在Websphere的servlet 引擎中,直到下面的情况发生:

(1)、谟τ弥忻魅返氖褂?lt;/SPAN>API来释放它,javax.servlet.http.HttpSession.invalidate ()

这个方法十分常用,图2a提供了一个例子。

(2)、在HttpSession的生存期满的时候WebSphere Application Server就会销毁那些已经分配的HttpSession(默认的,1800秒或30分钟)。WebSphere Application Server只能在内存中维护一定数量的HttSeesion对象。在这个限制到达的时候,WebSphere Application Server会将分配的HttpSession序列化到磁盘中,并与之交换。不过在一个高吞吐量的系统中,序列化无用的HttpSession对象的所耗费的资源相当高。