Monday, April 11, 2011

If an object is stored in a Session and updated will the state be replicated across all the other distributed sessions in the Cluster ?

The simple answer is no. E.g. if you have added "Employee" object in the Session by using the setAttribute and if you update a member of the Employee object e.g. Salary (I really love this part :-) ) , then in that case the update would not be reflected in other Sessions across the cluster.

To ensure that the same happens you would need to invoke the setAttribute method on the Session as this would only trigger the replication to happen across clusters.

No comments:

Post a Comment