Uploaded image for project: 'IronJacamar'
  1. IronJacamar
  2. JBJCA-593

AbstractPool returns the wrong ConnectionListener if more than one ManagedConnectionPools are used in a given transaction

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 1.0.0.CR1
    • 1.0.0.Beta6
    • Core
    • None

      The way that AbstractPool uses the TransactionSynchronizationRegistry appears to be incorrect.
      I discovered that if two XA pools exist and both are used in a transaction, the second pool hands out a reference to the first pool's ConnectionListener in getTransactionOldConnection().
      The reason is that AbstractPool uses TSR.getResource() and TSR.putResource() using a key based on the current Transaction. When the second pool checks for an existing connection, it uses the same key as the first pool (since it exists in the same transaction).

      I believe the correct approach is to use a key that is based on the relevant ManagedConnectionPool instead of the current Transaction.

      A patch with tests will be added soon.

              jpederse@redhat.com Jesper Pedersen
              matt.drees2 Matt Drees (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: