tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: non-serializable objects in sessions
Date Mon, 12 Nov 2001 06:05:28 GMT

On Sun, 11 Nov 2001, Marko Asplund wrote:

> Date: Sun, 11 Nov 2001 21:37:07 +0200 (EET)
> From: Marko Asplund <>
> Reply-To: Tomcat Users List <>
> To:
> Subject: non-serializable objects in sessions
> how should non-serializable objects be stored in HttpSessions? i'd like to
> be able to use the PersistentManager for storing the serializable objects
> inside sessions while skipping the non-serializable objects like database
> statement handles. how can this be accomplished with Tomcat v4.0.1?

It can't.

There is no way in Java to persist a non-Serializable object like a
database statement.  In fact, you cannot even use such a thing if you're
using a connection pool (completely separate from session persistance
issues) unless the connection pool itself implements support for this.

If you need persistence, you have to be aware of what can and cannot be
persisted.  It's possible that Enterprise JavaBeans (EJBs) might be a
better solution to the types of problems you are looking at, because they
deal with low level persistence issues for you.

> --
> 	aspa

Craig McClanahan

To unsubscribe:   <>
For additional commands: <>
Troubles with the list: <>

View raw message