In the book "SCBCD Exam Study Kit" the author Paul Sanghera writes:
Can client use EJB object reference after calling a successful remove()?
the answer is:
Stateless Session Bean: No. If used, it will receive an exception.
I tried to call remove method on the var, that reffers to the EJBObject of the session bean instance, and after call business - method. I didn't catch any exception. I carried out this experiment with Bea WebLogic 8 server and JBoss server.
In the EJB 2.0 spec I hasn't found any information.
Hi, As you must be knowing that in Sateless session bean when you invoke any method on bean instance,after completing the its body (i.e. exit point of method) the bean instance is aotomatically de-associated with EJBObject.So even if you call EJBRemove on your EJBObject it doesn't matter.But as far as original query is concern that is 100% true but how to simulate that is big question. Reason is if there is no instance is currently associated with EJBObject and you try to call any method than it will throw exception. and we must remember by calling EJBRemove on Seesion bean it de-associate bean instance with EJBObject if any. may be that is useful ?
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop