[jboss-jira] [JBoss JIRA] Created: (JBAS-7285) Lazy initialization fix for wrong use case.

Vicky Kak (JIRA) jira-events at lists.jboss.org
Wed Sep 23 01:35:49 EDT 2009


Lazy initialization fix for wrong use case.
-------------------------------------------

                 Key: JBAS-7285
                 URL: https://jira.jboss.org/jira/browse/JBAS-7285
             Project: JBoss Application Server
          Issue Type: Bug
      Security Level: Public (Everyone can see)
          Components: JCA service
            Reporter: Vicky Kak
            Assignee: Vicky Kak
             Fix For: JBossAS-5.2.0.GA, JBossAS-Branch_4_2


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.

-- 
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