tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amit Chandel <>
Subject Re: serializing session in DB
Date Tue, 03 Mar 2009 02:58:20 GMT
Hi Chris,

I would love to see an example of such a filter.


On Mon, Mar 2, 2009 at 5:43 PM, Christopher Schultz
<> wrote:
> Hash: SHA1
> Amit,
> On 3/2/2009 4:21 PM, Amit Chandel wrote:
>> But only issue is that Tomcat doesn't persist sessions to DB
>> synchronously as is the case with in-memory replication where session
>> data is first replicated and then the request gets served. So if
>> master fails, and the session data has not been persisted, subsequent
>> requests going to the other tomcat node will see old session data
>> from DB, and might frustrate the *user*. I would like to know how
>> synchronous persistance of session data with Tomcat is done in
>> practice.
> I have no experience with JDBCStore, but you could always implement your
> own SessionManager that does synchronous database updates.
> If you don't want to implement a SessionManager (which might be a bit
> heavy-handed and certainly Tomcat-specific), you could also write a
> filter that wraps the HttpSession with your own object that does
> synchronous DB reads and writes. This might also save you a LOT of RAM.
> If you use the database exclusively for session attribute data, your
> in-memory footprint for sessions could drop dramatically.
> If you'd like an example of such a filter, I could probably provide one.
> - -chris
> Version: GnuPG v1.4.9 (MingW32)
> Comment: Using GnuPG with Mozilla -
> 1ZoAniNvoh/NGQ5N1VnkGw5yr55S4hgN
> =xPGx
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message