0 Replies Latest reply on Jul 27, 2004 6:27 PM by Varun Rupela

    Is it possible to control the number of retries on Naming.lo

    Varun Rupela Newbie

      Currently, org.jnp.interfaces.NamingContext caches NamingServerStubs and retries the Naming.lookup() call MAX_RETRIES number of times. MAX_RETRIES is set to 10 as part of its declaration and is non-configurable as far as I know.

      Is there a way to control the number of retries made by org.jnp.interfaces.NamingContext.lookup() when the Naming.lookup() call fails?

      Following is a brief description of the scenario when this would be useful (to me anyway):

      - A plain old java object tries to lookup a remote ejb using org.jnp.NamingContextFactory as its JNDI service provider.
      - It succeeds the first time. Which means that a NamingServerStub for the remote machine has been cached by org.jnp.interfaces.NamingContext.
      - Unplug the remote machines network cable.
      - Try to lookup the same ejb again. An exception is thrown from the NamingContext after 10 retires for lookup(). This takes 3-4 minutes.
      - I need to reduce that length of time.
      - Is there a way that can be done by configuring some properties?
      - Other options would be to manage the connection timout myself via threads or direct tcp/ip calls. Is there another option?


      Thanks.

      Varun Rupela.