• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Local Objects and remove() operation

 
Phanindra Nayani
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
For local EJBs is there any restriction for using remove() in LocalHome and EjbLocalObject regarding EB, SFSB and SLSB? i.e.,
1) Can EjbLocalObject.remove() be called on local SFSB?
2) Can EjbLocalObject.remove() be called on local SLSB?
3) Can EjbLocalObject.remove(), EjbLocalHome.remove(Obj pk) be called on local EB?
Thanks,
Phani
 
Vishwa Kumba
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1.Yes
2.Yes
3.Yes
 
Phanindra Nayani
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I still have 1 doubt left. If EJBLocalObject.remove() is called on local SLSB, what will happen to EJBObject and Bean instances? Will the bean go back to pool or will it die permanently? What about EJBObject instance? Onemore thing, is there any restriction not allowing the usage of EJBLocalObject.remove()?
[ February 23, 2004: Message edited by: Phanindra Nayani ]
 
Reid M. Pinchback
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For SLSB 'remove' allows the client to tell the server that it doesn't intend to make any more requests. It allows the container to GC the EJBObject/EJBLocalObject skeleton instance, or whatever kind of housekeeping the container does for the container-side end of the communication. The bean instance itself goes wherever the container wants it to go - typically the pool.
As for restrictions, you can't remove something that has already been removed. It won't break anything in the container, but the client would have to catch and ignore an exception. Typically the exception will be java.rmi.NoSuchObjectException (for remote invocations) or javax.ejb.NoSuchObjectLocalException (for local invocations). Strictly speaking you could also get a java.rmi.RemoteException (e.g. if the network was down so you couldn't get to the server to even find out that the EJBObject was unavailable).
 
Phanindra Nayani
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thankyou Guys !!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic