[jboss-jira] [JBoss JIRA] Commented: (JBAS-5253) RetryInterceptor that caches JNDI lookup details per EJB type

Galder Zamarreno (JIRA) jira-events at lists.jboss.org
Thu Feb 28 04:55:42 EST 2008


    [ http://jira.jboss.com/jira/browse/JBAS-5253?page=comments#action_12400811 ] 
            
Galder Zamarreno commented on JBAS-5253:
----------------------------------------

Workaround caveats:

Re 3.- Setting RI JNDI lookup details before each EJB call can 
be done in two different ways:

3.1.- Call RetryInterceptor.setRetryEnv(env1); before each remote
call passing the corresponding lookup properties for that EJB. Downside
of this option is that calling setRetryEnv(env1) sets a static field which 
is not thread safe. All sorts of problems could arise when using this 
option in a multithreaded environment.

3.2.- Alternatively, call NamingContextFactory.lastInitialContextEnv.setEnv(env);
before each remote call passing the corresponding lookup properties for that 
EJB. NamingContextFactory.lastInitialContextEnv is a thread local variable and 
therefore setting it has no thread safety issues.

3.1 and 3.2 alternatives are possible because RI checks whether the static 
variable has been set, and if not, uses the thread local variable:

      Hashtable retryProps = retryEnv;
      if (retryProps == null)
      {
         retryProps = (Hashtable) NamingContextFactory.lastInitialContextEnv.get();
         if ( trace )
         {
            if (retryProps != null)
               log.trace("Using retry properties from NamingContextFactory");
            else
               log.trace("No retry properties available");
         }
      }

> RetryInterceptor that caches JNDI lookup details per EJB type
> -------------------------------------------------------------
>
>                 Key: JBAS-5253
>                 URL: http://jira.jboss.com/jira/browse/JBAS-5253
>             Project: JBoss Application Server
>          Issue Type: Feature Request
>      Security Level: Public(Everyone can see) 
>          Components: Clustering, Naming
>            Reporter: Galder Zamarreno
>         Assigned To: Galder Zamarreno
>            Priority: Minor
>
> Configuring a remote EJB client, whether standalone or within AS, to use 
> RetryInterceptor (RI) when EJBs are deployed across different node/clusters
> can be a bit tricky cos jndi details to be used by interceptor are stored statically. 
> There're several available workarounds which I'll explain in the workaround 
> section. This JIRA is focused at the feasibility of creating a more intelligent RI 
> that caches JNDI lookups as per EJB type.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list