the following methods will be causing replication setAttribute removeAttribute setMaxInactiveInterval (or whatever it is called) setPrincipal (when someone logs in)
Filip -----Original Message----- From: John Sidney-Woollett [mailto:[EMAIL PROTECTED] Sent: Monday, January 12, 2004 2:38 PM To: Filip Hanik Cc: Tomcat Users List; [EMAIL PROTECTED] Subject: RE: Replication question Thanks Filip Perhaps you could help me clear up a little confusion. 1) If useDirtyFlag="false" then the session is replicated EVERY time the servlet container processes a request which has a session. If in 10 requests for one user, a session attribute is modified in one of the requests only, then 10 replication attempts would have been attempted although only one was really needed. 2) If useDirtyFlag="true", what other calls cause replication? Hopefully not session.getAttribute() :) Thanks for your help. John Filip Hanik said: >>Do I just call session.setAttribute("MyObject", myObject) > > YES, that will take care of it. > > if you do set the property useDirtyFlag="false" your session will be > replicated on each request, not good for performance but it takes care of > code like this > > Map map = session.getAttribute("map"); > map.put("name","value"); > return; > > in this case, the session replication code doesn't know that anything > changed, hence you don't want to use the dirty flag > > the useDirtyFlag=true replicates the session when > setAttribute,removeAttribute and some other methods are called > > Filip > > > -----Original Message----- > From: John Sidney-Woollett [mailto:[EMAIL PROTECTED] > Sent: Monday, January 12, 2004 9:35 AM > To: [EMAIL PROTECTED] > Subject: Replication question > > > Hi > > For replication purposes (2 or more tcs in a cluster), how do you let the > sessionlistener know to re-replicate your session after you make a change > to a property of an object which is bound to the session, but where the > session attribute + object iself remains unchanged? > > For example, if I bind a (lightweight and serializable) class to the > session and change one of its properties, how do I notify Tomcat that I > want the session replicated again. Probably as far as TC and the > replication code is concerned it doesn't need to do anything because no > attribute changes are recorded. > > Do I just call session.setAttribute("MyObject", myObject) again (where the > myObject reference is the same as before), or do I have to remove and then > re-add the attribute? Or is there something that I have missed? > > Also, if you add many attributes during a single servlet call, is the > replication buffered and delayed until the servlet sends its response, or > is the replication attempted each time the session's attributes are > changed? > > When does anyone think that the recent replication fixes will make it into > the next official release? > > Thanks for any info. > > John Sidney-Woollett > > --------------------------------------------------------------------- > 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]
