[jboss-jira] [JBoss JIRA] Updated: (JBAS-5906) Client user transaction lookups aren't closing initial contexts

Galder Zamarreno (JIRA) jira-events at lists.jboss.org
Wed Sep 3 09:44:38 EDT 2008


     [ https://jira.jboss.org/jira/browse/JBAS-5906?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Galder Zamarreno updated JBAS-5906:
-----------------------------------

        Fix Version/s:     (was: JBossAS-5.0.0.CR2)
    Affects Version/s:     (was: JBossAS-5.0.0.CR1)


> Client user transaction lookups aren't closing initial contexts
> ---------------------------------------------------------------
>
>                 Key: JBAS-5906
>                 URL: https://jira.jboss.org/jira/browse/JBAS-5906
>             Project: JBoss Application Server
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: Transaction Manager (JBossTM)
>    Affects Versions: JBossAS-4.2.3.GA
>            Reporter: Adrian Brock
>            Assignee: Galder Zamarreno
>             Fix For: JBossAS-4.2.4.GA
>
>
> There are a number of places in the UserTransaction initialisation and TxPropogationContextUtil
> that are doing jndi lookups() without closing the initial context.
> Typically 
> new InitialContext().lookup(...);
> This is inefficient since on the client side this will mean an rmi connection is open
> until it gets garbage collected.
> This has already been fixed in JBoss5 for the TxPropogationContextUtil (correct code should look like this)
>          try
>          {
>             InitialContext ctx = new InitialContext();
>             try
>             {
>                tpcFactory = (TransactionPropagationContextFactory) ctx.lookup(EXPORTER_JNDI_NAME);
>             }
>             finally
>             {
>                ctx.close();
>             }
>          }
>          catch (NamingException e)
>          {
>             throw new RuntimeException("Unable to lookup " + EXPORTER_JNDI_NAME, e);
>          }

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

        



More information about the jboss-jira mailing list