tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Will Hartung" <>
Subject Re: Clustering "application scope replication"
Date Fri, 22 Apr 2005 18:48:06 GMT
> From: "J. Ryan Earl" <>
> Sent: Friday, April 22, 2005 7:44 AM

> How does Tomcat know what to serialize?  Does it just use the Reflection
> package and serialize out -everything- that implements

When you do a "setAttribute(key, object)", it serializes the object out for
replication, so, both your key and object needs to be serializable. It uses
the generic Java writeObject method.

This is why you need to use setAttribute to ensure your changes are
replicated, and why you can not just change an object directly and expect it
to be replicated.

So, if you are storing, say, a long ArrayList of objects in your session
(like, say, query results), you must use setAttribute(yourList) each time
you make a change to anything in the list, and then it serializes the ENTIRE
list for replication, not just your changes. (And thus we see some of the
limits of replication, at least some of the things you need to be aware of.)


Will Hartung

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message