Uploaded image for project: 'Commons DBCP'
  1. Commons DBCP
  2. DBCP-428

Unsuccessful Connection enlistment in XA Transaction ignored by TransactionContext

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.4, 2.0.1
    • Fix Version/s: 2.1
    • Labels:
      None
    • Environment:

      All

      Description

      When TransactionContext call 'enlistResource()' on Transaction it is ignored returned result. This hapens at least when XAResource throws XAException in enlistResource method. By contract XAException should not be propagated by 'enlistResource()' , instead 'false' is returned.
      As result:
      1. ManagedConnection returned by pool is not enlisted in transaction (application think it does)
      2. Transaction itself marked for rollback (because of XaException).
      3. ManagedConnection returned by pool used by application without any errors until commit on transaction is called. Changes made in not enlisted connection may be commited on other use of native connection or rolled back depending on pool config.

      Issue is very dangerous especialy if changed made by application will be commited later but XA transaction in witch it made has bin rolled back.

      We are hit by this bug in production using MS SQL Server and PostgreSQL JDBC drivers.

        Attachments

        1. DBCP-428.diff
          1 kB
          Vladimir Konkov

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              vladimirfx Vladimir Konkov
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: