We have web application that needs to support clustering i.e. persisted appserver sessions. Currently, a lot of the objects we store in the HTTP session are not Serializable and therefore any attempts to cluster the appserver fail. To solve this we obviously need to determine what objects need to be Serializable and perform any refactoring required to make them Serializable.
So, do you now any pattern or best practice to perform this task?
Joined: Jan 29, 2003
Hi, welcome to the ranch!
I ran across the same issues with a vendor framework ... some of the objects they placed on the session would not serialize. We just modified the framework to not put them there. Making your session smaller is A Good Thing at this point.
If you can't get rid of such things, waiting for them to fail is about your only choice unless you can tightly control what goes on the session. Do you have a point - maybe a front controller - where you could wrap the Session with an implementation that only allows clients to put serializable objects?
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Joined: Sep 03, 2007
Thanks a lot for your solution!
There are some additional problems. Almost all business objects and backing beans in our JFS application are not implement Serializable. So, there is really a big amount of handwork.
After we implement serialization we need to test its capabilities. One of the possible test scenarios is to serialize and deserialized objects during their adding to HTTP session. Disadvantage of this approach is that we need to surfing web application and there is no guarantee that we test all objects in such way.