Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 08FFCD47D for ; Wed, 19 Sep 2012 19:56:07 +0000 (UTC) Received: (qmail 99182 invoked by uid 500); 19 Sep 2012 19:56:03 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 99020 invoked by uid 500); 19 Sep 2012 19:56:03 -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 99011 invoked by uid 99); 19 Sep 2012 19:56:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Sep 2012 19:56:03 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [76.96.59.228] (HELO qmta15.westchester.pa.mail.comcast.net) (76.96.59.228) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Sep 2012 19:55:57 +0000 Received: from omta05.westchester.pa.mail.comcast.net ([76.96.62.43]) by qmta15.westchester.pa.mail.comcast.net with comcast id 10vp1k0030vyq2s5F7vz8N; Wed, 19 Sep 2012 19:55:59 +0000 Received: from Christophers-MacBook-Pro.local ([69.143.109.145]) by omta05.westchester.pa.mail.comcast.net with comcast id 17vq1k00e38FjT13R7vuZq; Wed, 19 Sep 2012 19:55:55 +0000 Message-ID: <505A2332.4010306@christopherschultz.net> Date: Wed, 19 Sep 2012 15:55:30 -0400 From: Christopher Schultz User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: Tomcat Users List CC: Pid * Subject: Re: sessions replication References: <3925735849765296642@unknownmsgid> In-Reply-To: <3925735849765296642@unknownmsgid> X-Enigmail-Version: 1.4.4 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 Pid, On 9/19/12 2:08 PM, Pid * wrote: > On 19 Sep 2012, at 16:59, "Carrillo, Dan" > wrote: > >> Hi folks, My sessions are replicating across the cluster as >> indicated by my session listener debug output. E.g I can see the >> session created/destroyed messages in each respective log. I have >> a Service object that is serializable, which contains a String >> member variable (x) which is not initialized; null. As my load >> balancer round-robins the requests to each of these servers, each >> successfully retrieves the service instance from the session. >> Now, when service.x is set at some point in the workflow, I >> expect the other members to receive this updated object since it >> resides in the session. However, I'm finding that it is not, it >> remains null in all other containers. >> >> The tomcat config >> (http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html) says >> that "..For each request the entire session is replicated, this >> allows code that modifies attributes in the session without >> calling setAttribute or removeAttribute to be replicated." >> >> Can someone clarify whether I do in fact need to reset the >> service object on the session in order for it to replicate? > > If by this, you are asking whether you can retrieve an object from > the session, update it and without adding it back to the session > expect these changes to be propagated, then no, you can't. That note in the official documentation certainly is misleading. I believe that the session is is only marked "dirty" if one of HttpSession.setAttribute or HttpSession.removeAttribute is invoked. I think the statement in question indicates that, if the HttpSession is to be replicated, it will be replicated in full and not piecemeal. But you still have to call HttpSession.setAttribute in order to trigger the replication in the first place. - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iEYEARECAAYFAlBaIzIACgkQ9CaO5/Lv0PC+MgCeOymBWWhOx5lDtBBAN79VSbDB UK8An3O5/EBUYM7D1Biy8z0CenAhKzHB =m6N6 -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org