Value bound and unbound is the way to do this.  I have an object that
creates and destroys "temp" tables in my database this way.  It's kinda
clunky, but it works.

When the object is unbound (either it is removed from the session or the
session is invalidated) you'll get an event.  As long as you don't
remove the object yourself you ought to be mostly ok.  With tomcat 3.x I
have the issue that sometimes I have to kill -9 tomcat (not often) which
doesn't trigger the value unbound event, but it's mostly ok.

--mikej
-=-----
mike jackson
[EMAIL PROTECTED]

-----Original Message-----
From: Alexander Wallace [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 17, 2003 8:23 AM
To: Tomcat Users List
Subject: Get object from session before it expires.

I've been searching and just want to make sure I was told correctly.

I was told in an IRC that there is no way to get an object from a
session 
before it expires. 

I know you can listen for valueUnbound, but that tells me when all
instances 
of a class are being unbound.

I know you can listen to sessionDestroyed and get the session from the 
HttpSessionEvent, but by then the session has already been invalidated
and I 
can't get a hold on a particular object.

What I need is to know before a session is invalidated, so that I can
pull a 
particular instance of a class from the session and update a database
with 
it.

I was told that is not possible... Is this right? Any suggestions?

Thanks in advance!


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to