tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
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 <aspa@kronodoc.fi>
> Reply-To: Tomcat Users List <tomcat-user@jakarta.apache.org>
> To: tomcat-user@jakarta.apache.org
> 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:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message