Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-5906

Client user transaction lookups aren't closing initial contexts

    XMLWordPrintable

Details

    Description

      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); }

      Attachments

        Issue Links

          Activity

            People

              rh-ee-galder Galder ZamarreƱo
              adrian.brock Adrian Brock (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: