Problem:
- Product Name: VisiBroker for Java
- Product Version: 5.2.x
- Product Component: ORB, Communication
- Platform/OS Version: Windows 2000/NT/XP
The server hangs when calling back to an Applet client running in Internet Explorer web browser even after the user leaves the page with the page or the browser has been closed. This also happens when the server is calling back through GateKeeper. Similar behavior has been observed for Mozilla/Netscape browsers.
Resolution:
While applying a QoS RelativeRoundTrip timeout will prevent the server from hanging indefinitely the root cause of this issue is in the client side behavior.
The problem here is that even after the user leaves the page the ORB instance created for the Applet is not destroyed. This is because IE caches the JVM and keeps it running in case it needs it for later Applets. Thus the ORB instance will remain running as long as any browser window remains open (since the JVM is shared between all IE instances).
When the server/gatekeeper calls back to the client applet the ORB instance is still running so the client side connection is still open and so the request is accepted but since the Applet is gone the request cannot be processed and the callback never completes (leaving the server side hanging).
The correct approach to addressing this is to fix the client side behavior. The Applet should kill the ORB instance it initialized. This can be accomplished by overriding the Applet stop method as follows:
public void stop() {
orb.shutdown(false);
}
It might also be advisable to similarly override the Applet destroy() method
public void destroy() {
orb.shutdown(false);
}
Now when the browser window is closed or the user leaves the page the ORB instance is shutdown and all associated connections are closed. The server then receives and OBJECT_NOT_EXIST exception when making the callback and can deal with that as appropriate.
#VisiBroker
#Security




