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
[EMAIL PROTECTED]
-------------------------------------------- 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to