tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <rolf.sch...@ubs.com>
Subject tomcat 5.0.28 cluster with useDirtyFlag="false" and NO session.setAttribute(...) within request.
Date Wed, 15 Sep 2004 08:24:32 GMT
Hello all,

We have the following tomcat cluster setup:

 - Reverse Proxy: 
	Apache reverse proxy which distributes every request to different tomcat instance. Works
fine.

- Tomcat Cluster:
	Cluster with 2 instances, pooled synchronization using mcast, useDirtyFlag="false"

Replication as such works fine except to the following code:


A)
-- code snipped --

	SessionContext sessionContext = getSessionContext(request); // session.getAttribute("session.context");
	sessionContext.setSelectedParticipant("11"); // previous value e.g. is "10"
-- code snipped --

With this code above, we read an already and successfully replicated object (sessionContext)
from the session. After fetching the object, we modify one of its values. Please note, we
do not call session.setAttribute(...) in this scenario.

Having the useDirtyFlag="false", we expect the whole session beeing replicated everytime before
the request has ended (pooled synchronization). However, on the next request (to the second
tomcat instance) getSelectedParticipant() still returns "10". The following request to the
first tomcat instance shows the changed value "11". 


B)
If we change our code to the following, session replication works and will show value "11"
in both cases:

-- code snipped --

	SessionContext sessionContext = getSessionContext(request); // session.getAttribute("session.context");
	sessionContext.setSelectedParticipant("11"); // previous value e.g. is "10"
	request.getSession().setAttribute(
                    SessionContext.CONTEXT_KEY,
                    sessionContext);
-- code snipped --

Please note, that in scenario B) we have explicitly called session.setAttribute(...), means
we are replacing a session attribute. With this, the session get replicated successfully.


Did we missunderstand the useDirtyFlag="false" for scenario A) in combination with pooled
synchronization? Any help is warmly appreciated.

Best Regards,

Rolf Schenk

	



--------------------------------------------
Rolf B. Schenk
Equate+ IT Architecture & Development
CEFS EU

UBS AG
Buckhauserstrasse 22
8048 Z├╝rich
+41-1-2348594
rolf.schenk@ubs.com
-------------------------------------------- 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message