I agree that it worth to avoid storing session in DB. It is not
reasonable to load session data from DB every 20 seconds.
You can handle session create/destroy events using class that
implements following interface.
http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/http/HttpSessionListener.html
--
Best regards,
Dima mailto:dima@(protected)
Tuesday, December 19, 2006, 7:15:41 PM, you wrote:
bs> Chuck,
bs> Valid points.
bs> I was hoping that doing it this way would also provide me with
bs> replication of this data between several tomcat instances. Odviously I
bs> would need to setup session replication between them. Also it would
bs> allow for session data persistence should tomcat be restarted etc. I
bs> could grab the requestedSessionId from the request and then use that
bs> to look up the session data.
bs> I know that tomcat provides some way of persisting session but the
bs> documentation doesn't seem to be very good.
bs> Ben
bs> On 12/19/06, Caldarale, Charles R
bs> <Chuck.Caldarale@(protected):
>> > From: ben short [mailto:jamin.short@(protected)]
>> > Subject: Notification of expiring sessions
>> >
>> > I want to store user session data into a database rather than in the
>> > session, to conserve memory.
>>
>> Unless your session data is huge, you're probably consuming more memory
>> by accessing the data base rather than keeping it simple. There are a
>> lot of objects that have to be created and maintained for every DB
>> connection, statement, result set, etc. Also, your original session
>> data object(s) will remain in the heap until garbage collection runs, so
>> are you really conserving memory?
>>
>> - Chuck
>>
>>
>> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
>> MATERIAL and is thus for use only by the intended recipient. If you
>> received this in error, please contact the sender and delete the e-mail
>> and its attachments from all computers.
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@(protected)
>> To unsubscribe, e-mail: users-unsubscribe@(protected)
>> For additional commands, e-mail: users-help@(protected)
>>
>>
bs> ---------------------------------------------------------------------
bs> To start a new topic, e-mail: users@(protected)
bs> To unsubscribe, e-mail: users-unsubscribe@(protected)
bs> For additional commands, e-mail: users-help@(protected)
---------------------------------------------------------------------
To start a new topic, e-mail: users@(protected)
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)