• Post Reply Bookmark Topic Watch Topic
  • New Topic

Stub and serialization

 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want to know why do we need EJBHandle when we can serilaize stubs. If stubs weren't serializable we would not be able to dynamically download them.
I was just wondering if it was because we are programming to an interface i.e. EJBObject rather than some implementation class and EJBObjects themselves are not serializable. Am I right?
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No reply!
 
Vinod John
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Pradeep Bhat:
Hi,
I want to know why do we need EJBHandle when we can serilaize stubs. If stubs weren't serializable we would not be able to dynamically download them.
I was just wondering if it was because we are programming to an interface i.e. EJBObject rather than some implementation class and EJBObjects themselves are not serializable. Am I right?


From what I understand, the stubs are for remotly accessing remote interfaces and not the bean, but a handle actually an identifies a particular EJB in the server. So serializing stub dosen't solve the purpose ... Think you too mean the same ???
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If stub cannot identify the EJBObject how can it invoke calls on the server.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
  • You can serialize the handle and acquire an EJBObject reference from it after a server restart. This is clearly stated in the specification.
  • An EJBObject reference does survive a server restart. Furthermore, you might be able to serialize the EJBObject reference and acquire an EJBObject reference afterwards, depending on the application server's implementation because the client-side stubs need not be serializable.


  • Does everyone agree with these statements?
     
    Pradeep bhatt
    Ranch Hand
    Posts: 8933
    Firefox Browser Java Spring
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Why is the stub not serializable ? If it not then how does it get dynamically downloaded.
    Are you saying that we need to copy the stub in the clients classpath and stub does not get downloaded.
    If we need to copy the stub in the clients classpath then the stub need not be serializbale but is it how it work. Stubs should be dynamically downloadable.
    I havent found any asnwer for this question.
    [ August 15, 2003: Message edited by: Pradeep Bhat ]
     
    Vinay Vijayan
    Greenhorn
    Posts: 3
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hi Pradeep,
    In some app servers, stubs get automatically downloaded and in some it has to be in classpath.
    say, in Iplanet : stubs has to be in classpath.
    In jboss : stubs are automatically downloaded.
    I believe these things are container specific, what do you say!
    bye
    vinay
     
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!