Shahed Ali wrote:
Hi, Does tomcat seralize session objects ? 1. If it does, and I have non serializable objects like SQL Connections sitting in my session, then what should I do ? 2. If it does not, and I have a lot of sessions lying around, then will tomcat crash due to memory limitations ? ThanksShahed
The servlet 2.2 spec requires session attributes to be serializable, *if* you declare your app to be <distributable/> in the web app deployment descriptor. Tomcat 4.0 enforces this requirement; 3.2 does not. There are current discussions on TOMCAT-DEV around supporting distributable and/or persistent sessions in Tomcat 4.1 -- if you want your app to be able to take advantage of this when it becomes available, you should start conforming to the "session attributes must be serializable" restriction now. NOTE -- some app server environments enforce more rigorous requirements outside the servlet spec; for example, they may require that session context attributes be Serializable as well. Tomcat will only "crash" (more properly, some web app will receive an OutOfMemoryException) if the sum total of all the objects in the JVMs memory space exceeds the available memory allocated to the JVM -- just like any Java app will. You can do several things in your web app design to minimize the impact of this: * Shorten the lifetime of your sessions by setting the
* Call session.removeAttribute() to remove session
* Allocate more memory to your JVM than the default
Craig McClanahan
|
- Session Object Serailization Shahed Ali
- Re: Session Object Serailization Sean Kroah
- Re: Session Object Serailization Alef Arendsen
- Re: Session Object Serailization Craig R. McClanahan
- Re: Session Object Serailization Sean Kroah
- Re: Session Object Serailization Craig R. McClanahan
- Re: Session Object Serailization Shahed Ali
- Re: Session Object Serailization Craig R. McClanahan
