Re: Session values don't replicate under certain circumstances

2008-08-13 Thread Adrian Gligor

Thank you Filip,

that's not the answer I would have liked, but at least I know I cannot  
get away without changing the code.


Adrian

On 13. Aug. 2008, at 18:31, Filip Hanik - Dev Lists wrote:

that's correct. there are a number of frameworks that detect these  
kind of changes, Tomcat doesn't, everything is triggered by  
setAttribute/removeAttribute


Filip

Adrian Gligor wrote:

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.






-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Session values don't replicate under certain circumstances

2008-08-13 Thread Adrian Gligor

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.




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]