Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

doubt

 
Steve Agarwal
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please correct me if i am wrong.
1) stateless session beans doenst have handle for serialization
2) local SFSB doesnt have handle for serialization (WHY)
Steve
 
hover cheng
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let me have a try. Whether handles can be derived from ejb home/component interfaces depends on whether it's local or remote. For local home/component interfaces, they cannot; for remote home/compoent interfaces, they can.
I think the reason is, for references to remote home/component interfaces, they are NOT guranteed serializable, so it need some machnism(handles)serializable in order to pass them through network; but for references of local home/component interfaces, they are NOT intended to be passed through network (actually, they are pass-by-reference only locally).
 
Steve Agarwal
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let me have a try. Whether handles can be derived from ejb home/component interfaces depends on whether it's local or remote. For local home/component interfaces, they cannot; for remote home/compoent interfaces, they can.
I think the reason is, for references to remote home/component interfaces, they are NOT guranteed serializable, so it need some machnism(handles)serializable in order to pass them through network; but for references of local home/component interfaces, they are NOT intended to be passed through network (actually, they are pass-by-reference only locally).

handle are obtained by EJBObject.getHandle()... ( I am sorry I dont think they are derived. )
I am confused with now. As per my know how Serialization is to do with marshelling and unmarshelling.
For SLSB -- no handle (remote + local ) -- makes sense as the client just runs the methods and dont care about the other things.
For SFSB -- we have handle for remote client. example Cart.
For the local cases why cant a servlet like to keep the handle of localHomeSFSB and use it later when the client returns. ( Local only say its in same JVM but dont we any scenario where local handle's use would be required. ) May be handle we only need for PortableRemoteObject.narrow( I am not sure on this ).
Steve
 
hover cheng
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Steve,
I notice that your question is based on that handles can not be obtained from SLSB. I am not sure where this is based. I only find the following in EJB 2.0 spec:

7.11.6 Handle classes
The deployment tools are responsible for implementing the handle classes for the session bean�s remote home and remote interfaces.

It does not discriminate stateful or stateless anyway, and I can not find anything asserting that handles can not be obtained from SLSB... Correct me if I am wrong.
Regards,
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is possible to obtain Handle for remote session beans.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic