users@glassfish.java.net

Howto restart remote EJB (CORBA) connection

From: <glassfish_at_javadesktop.org>
Date: Fri, 29 Jun 2007 02:30:29 PDT

Hi, i have a client which calls a number of remote EJB interfaces using something similar to the following:

[i]InitialContext ctx=new InitialContext();
BeanRemote bean=(BeanRemote )ctx.lookup(BeanRemote.class.getName());
bean.callMethod();
[/i]

The reference to the bean is then used throughout the lifetime of the client.

However for some reason (i've not found out what causes this yet, but seems to be related to the connection pool with a postgresql db) after a period of time (varies from minutes to days) the method call to times out with a corba timeout exception. and all subsequent attempts to create/use the bean fail.

If i restart the client, it connects and works fine.

Therefore my question is: Can i restart the underlying corba connection/Context and reconnect to the server within my code?
[Message sent by forum member 'jsl123' (jsl123)]

http://forums.java.net/jive/thread.jspa?messageID=224647