tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Gligor <adri...@gmx.net>
Subject Session values don't replicate under certain circumstances
Date Wed, 13 Aug 2008 15:52:28 GMT
Hello,

i have a working Tomcat 6.0.18 cluster with session replication using
DeltaManager and load balancing using mod_jk. The following problem does
not depend on having sticky sessions either on or off.

I'm putting an object into the session, and set one of its members:
    vo = new ValueObject();
    vo.name = "testvalue";
    request.getSession().setAttribute("valueobject", vo);

The object is correctly propagated onto all cluster nodes. I'm testing
this by setting sticky sessions off and printing the node name and
object value on each refresh. My requests bounce between the nodes as
expected, but the value of my object stays the same.

However, if I subsequently change the member, replication doesn't
trigger. It's like Tomcat doesn't detect the change:
    ValueObject vo = (ValueObject)
request.getSession().getAttribute("valueobject");
    vo.name = "testvalue2";

By doing this, my nodes are now out of sync. If I put the object into
the session again (setAttribute), the changes get replicated. However, I
have a big application here, and it would be very complicated to find
all occurences of this pattern.

My question is, is this behavior by design, or a bug? And is there any
way to work around it without changing (too much) code? I would
appreciate any hint.

Adrian

PS: I have attached the source code and .war file of a very simple test
application that will demonstrate this behavior.





Mime
View raw message