How set timeout in a EJB remote lookup?

Hello,

how can I set the timeout of a remote lookup?

InitialContext ctx = new InitialContext();

EJB2Remote ejb2RemoteWithLookup = (EJB2Remote)ctx.lookup("java:comp/env/ejb/EJB2");

If EJB2 is a bean that reside on a remote server and that server isn't reachable, the lookup fails after about 30-40 seconds. It's possible to set the timeout to 5 seconds?

I use SJSAS 9.

Thank you,

Luca

[436 byte] By [becenga] at [2007-11-27 6:44:42]
# 1

Hi Luca,

We don't define a way to control this in the current implementation.There has been

an enhancement request filed for this issue.The overall usability when the server

is not available and a lookup is attempted needs to be improved. You can find additional

information here :

https://glassfish.dev.java.net/issues/show_bug.cgi?id=1026

--ken

ksaksa at 2007-7-12 18:16:11 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...