Hi,
Anybody have an idea how do i know whether my cached ejb handle is good? I mean how do i chk my stateful ejb is NOT timed out.
Thanks
Bhupesh
-
getting time remaining of Stateful EJB (3 messages)
- Posted by: Bhupesh Kokate
- Posted on: September 16 2003 12:17 EDT
Threaded Messages (3)
- getting time remaining of Stateful EJB by Ian Mitchell on September 16 2003 15:26 EDT
- getting time remaining of Stateful EJB by Bhupesh Kokate on September 16 2003 15:37 EDT
- getting time remaining of Stateful EJB by Ian Mitchell on September 16 2003 05:47 EDT
- getting time remaining of Stateful EJB by Bhupesh Kokate on September 16 2003 15:37 EDT
-
getting time remaining of Stateful EJB[ Go to top ]
- Posted by: Ian Mitchell
- Posted on: September 16 2003 15:26 EDT
- in response to Bhupesh Kokate
The standard way to deal with this is to assume that the bean is there, and be prepared to handle the NoSuchObjectException if it isn't, i.e:
"An EJB client can determine if an EJB object is valid by placing all method invocations that use the reference inside of a try/catch block that specifically catches the java.rmi.NoSuchObjectException, in addition to any other exceptions that the method needs to handle. The EJB client can then invoke the code to handle this exception"..."The code to create a new EJB object when the old one becomes invalid is the same code used to create the original EJB object" (from IBM WebSphere InfoCenter) -
getting time remaining of Stateful EJB[ Go to top ]
- Posted by: Bhupesh Kokate
- Posted on: September 16 2003 15:37 EDT
- in response to Ian Mitchell
I got your point. Thanks!!! But, I was just wondering... Is that the only way we can handle this situation?
I mean, I was thinking in the direction where Websphere container could provide me time remaining through some methods coz websphere always has this time out set in its descriptor files.
Thanks for the reply ... I really appreciate
Bhupesh -
getting time remaining of Stateful EJB[ Go to top ]
- Posted by: Ian Mitchell
- Posted on: September 16 2003 17:47 EDT
- in response to Bhupesh Kokate
The container has to keep its little secrets I'm afraid. Also I don't believe the time remaining can be predicted, because it is up to the container when to passivate/pool/remove *after* the timeout has expired.