public void logout(Handle handle)
{
ClientSession clientSession = (ClientSession) handle.getEJBObject();
(1)
clientSession.remove(); (2)
}
What if someone calls logout again (don't ask why) ? Currently, the code
bombs at the line (2) with the follwing exception:
<Jan 3, 2002 1:42:23 PM PST> <Info> <EJB> <EJB Exception in method: remove:
java
.rmi.NoSuchObjectException: Bean has been deleted.
java.rmi.NoSuchObjectException: Bean has been deleted.
at weblogic.ejb20.swap.DiskSwap.read(DiskSwap.java:156)
at
weblogic.ejb20.manager.StatefulSessionManager.getBean(StatefulSession
Manager.java:242)
at
weblogic.ejb20.manager.StatefulSessionManager.preInvoke(StatefulSessi
onManager.java:313)
at
weblogic.ejb20.manager.StatefulSessionManager.remove(StatefulSessionM
anager.java:754)
at
weblogic.ejb20.internal.StatefulEJBObject.remove(StatefulEJBObject.ja
va:86)
at
com.atinera.clientsession.ejb.ClientSessionEJB_i1eggl_EOImpl.remove(C
lientSessionEJB_i1eggl_EOImpl.java:468)
at com.atinera.business.login.ejb.LoginEJB.logout(LoginEJB.java:121)
My questions:
1) Why doesn't the code bomb at line (1); shouldn't that call give me the
exception ?
2) How do I work around this ? I tried catching the exception, but it
doesn't work, because it appears that the exception occurs "inside" the
remove() call.
Thanks
"Jamie Tsao" <jt...@atinera.com> wrote in message
news:3c34d239$1...@newsgroups.bea.com...
Handle.getEJBObject() doesn't verify that the underlying bean instance actually
exists. This would require a database read for entity beans and (possibly) a
disk read for stateful session beans so it's avoided.
We won't attempt to find the instance until you actually call a method on it.
>
> 2) How do I work around this ? I tried catching the exception, but it
> doesn't work, because it appears that the exception occurs "inside" the
> remove() call.
You can catch java.rmi.NoSuchObjectException
-- Rob
>
>
> Thanks