File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes session migration using serialization. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "session migration using serialization." Watch "session migration using serialization." New topic
Author

session migration using serialization.

william kane
Ranch Hand

Joined: Nov 21, 2000
Posts: 260
How does session migration happen using serialization/de serialization when the servers are deployed in different physical machines?
To put it more crudely, how can the serialized text file be used transported to the other JVM on a different physical machine for the other server instance to deserialize the session state.
Hope I am clear about my query,
Thanks in advance,
William Kane


Help me!Help you!!!
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3716
    
    5

That's one of the main purposes of serialization, to have the freedom to transfer JVM objects to other machines and invoke remote methods on them.

Precisely how's it done depends on which transportation mechanism you use as well as well as the software, although its usually some form of XML I believe. For example, EJB and Web Services both use a form of serialization to transfer objects via RMI. Some web servers will detect whether or not external calls or truly external or not, and skip deserialization/deserilization of local objects as a performance enhancement.
[ November 04, 2005: Message edited by: Scott Selikoff ]

My Blog: Down Home Country Coding with Scott Selikoff
william kane
Ranch Hand

Joined: Nov 21, 2000
Posts: 260
Originally posted by Scott Selikoff:
That's one of the main purposes of serialization, to have the freedom to transfer JVM objects to other machines and invoke remote methods on them.

Precisely how's it done depends on which transportation mechanism you use as well as well as the software, although its usually some form of XML I believe. For example, EJB and Web Services both use a form of serialization to transfer objects via RMI. Some web servers will detect whether or not external calls or truly external or not, and skip deserialization/deserilization of local objects as a performance enhancement.

[ November 04, 2005: Message edited by: Scott Selikoff ]

Thanks Scott,
But I am still not clear about your answer. How is session migration in web servers analogous to remote method invocation in EJB? Do we have a remote interface coming into play anywhere in this scenario? If no, how are the text files that have been serialized accessed to by the other web server to deserialize and reconstruct the migrated session?
Thanks again,
William Kane
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
Why are you saying text files? All objects attached to a HttpSession should be Serializable so the session can be serialized by the normal Java object serialization methods.
Are there servlet containers that serialize via XML?
Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: session migration using serialization.