Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 30090 invoked from network); 2 Mar 2009 22:43:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Mar 2009 22:43:54 -0000 Received: (qmail 15251 invoked by uid 500); 2 Mar 2009 22:43:41 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 15224 invoked by uid 500); 2 Mar 2009 22:43:41 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 15213 invoked by uid 99); 2 Mar 2009 22:43:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Mar 2009 14:43:41 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [76.96.30.56] (HELO QMTA06.emeryville.ca.mail.comcast.net) (76.96.30.56) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Mar 2009 22:43:31 +0000 Received: from OMTA05.emeryville.ca.mail.comcast.net ([76.96.30.43]) by QMTA06.emeryville.ca.mail.comcast.net with comcast id NGrk1b00Q0vp7WLA6NjAKG; Mon, 02 Mar 2009 22:43:10 +0000 Received: from [192.168.1.101] ([69.143.128.194]) by OMTA05.emeryville.ca.mail.comcast.net with comcast id NNj81b0034BnRt98RNj9zW; Mon, 02 Mar 2009 22:43:09 +0000 Message-ID: <49AC60F9.4070500@christopherschultz.net> Date: Mon, 02 Mar 2009 17:43:05 -0500 From: Christopher Schultz User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 To: Tomcat Users List Subject: Re: serializing session in DB References: <7f339cb30902281802q2e9cd26egef8fa27fa31a8d2b@mail.gmail.com> <49AC1616.1020408@christopherschultz.net> <7f339cb30903021321i7ab84b1ar384c0a8e7de9a4a6@mail.gmail.com> In-Reply-To: <7f339cb30903021321i7ab84b1ar384c0a8e7de9a4a6@mail.gmail.com> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org -----BEGIN PGP SIGNED MESSAGE----- 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 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkmsYPgACgkQ9CaO5/Lv0PBsWACfccJ6T9ZvIlRRhk65kpJ4BZc1 1ZoAniNvoh/NGQ5N1VnkGw5yr55S4hgN =xPGx -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org