dcsimg
Serialization in EJB
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Nijeesh_Balan
Posted On:   Monday, June 16, 2003 09:12 AM

when we do jndi lookup for a home object we get the home object reference..


does this mean that home object references are serialized..??

I am slightly confused by the fact.. when they say objects should be serialized if they have to travel via the network
but in this case aren't just the home and remote references travel via the network..
Plz clarify.


Thanks & Regards,

Nijeesh.

Re: Serialization in EJB

Posted By:   C_Murphy  
Posted On:   Wednesday, June 18, 2003 09:10 AM

The EJB home and remote interfaces both extend the Remote interface and as such are remoteable objects. It is the generated stub objects that are serialised across the network - proxy pattern. Standard RMI is happening under the covers here.


However, it you need to return objects as a result of say calling session bean business methods, then these objects are passed by value and a copy needs to be serialised across the network. Therefore these objects must implement the Serializable interface.


Hope this helps


www.liemur.com

Re: Serialization in EJB

Posted By:   Srivatsa_Manjunath  
Posted On:   Monday, June 16, 2003 10:47 AM

Any stateful object, to preserve its state need to implement serializable. Some of the application servers like for example weblogic during activities such as session replication and so forth the object would need to serialize and deserialize the objects contents to replicate its state to other servers distributed over a network. The only technique weblogic could use to recreate the object would be deserialization. In case of homes or remotes, that would be typical distributed system using stubs and skeletons. Serialization comes into play whenever there is a stateful object.
About | Sitemap | Contact