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

Lazy initialization fix for wrong use case.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 6.0.0.M5
    • None
    • JCA service
    • None

      The JCA lazy initialization does not work in the following sceanrio

      *********************************************************************
      DataSource ds = ...
      Connection c = ds.getConnection();
      UserTransaction ut = ...
      ut.begin();
      // Do work
      c = ds.getConnection(); // This should be avoided and looks antipattern.
      ut.commit();
      ut.begin();
      *********************************************************************

      Getting the connection again in the TX context causes the issue, the subsequent
      ds.getConnection() leads to multiple enlistment of the local XAResources
      and thus causing this warning
      http://www.jboss.org/community/wiki/Multiple1pc

      The application developers should not follow the above coding pattern, however we should fix the issue cropping due to this coding practice as it could lead some misbehaviour in container, there are no evidences about the misbehaviour but it had been reported by our customers.

            jpederse@redhat.com Jesper Pedersen
            vickyk_jira Vicky Kak (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: