I have an app that will hold a reference to a Stateful SessionBean for an extended period of time(hopefully forever). I've noticed that after a period of time, the reference becomes invalid. I assume that it's timing out.
Is there a was to tell that the remote reference has become stale other than calling a method on it and having it throw an Exception?
Thanks in advance.
I've always relied on the exceptions (I believe the exception is a NoSuchObjectException). The only other way I can think of is if there was perhaps a vendor-specific stub method that the Stub class exposed but was not part of the remote interface, but I've never used anything like this.
Thanks for your response.
That's pretty much what I expected, but was hoping I'd missed something.
If you are using a Weblogic Server. You should set the value of idle-timeout-seconds (as per requirements) in the weblogic-ejb-jar.xml file. I think that would solve your problem.
What happens when it does become stale? I'm storing a rference to a OrderEntry ejb and, after a while, it disappears form the session and, when I go to pull the reference, it is null. Thanks