Uploaded image for project: 'JBoss Transaction Manager'
  1. JBoss Transaction Manager
  2. JBTM-3325

Create a way to close XAResource at the end of the recovery cycle processing

    Details

    • Type: Enhancement
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 5.10.5.Final
    • Fix Version/s: None
    • Component/s: JTA
    • Labels:
      None

      Description

      From discussions about Narayana integration to Agroal (https://agroal.github.io/) there came an idea how to make easier for Agroal to integrate with Narayana recovery processing.

      Usually (or at least Agroal does so) the brand new XAResource is provided from the call of the XAResourceRecovery (https://github.com/jbosstm/jboss-transaction-spi/blob/7.6.0.Final/src/main/java/org/jboss/tm/XAResourceRecovery.java#L51).
      aka. Agroal implements the XAResourceRecovery and register it with the Narayana with adding it to with https://github.com/jbosstm/jboss-transaction-spi/blob/7.6.0.Final/src/main/java/org/jboss/tm/XAResourceRecoveryRegistry.java to be used in XARecoveryModule.

      When the periodic recovery cycle ends the XAResource is not used (next time the recovery processing calls the XAResourceRecovery#getXAResources() to get the resource for scanning again). The transaction manager announces that the scan ended with call XAResource.recover(XAResource.TMENDRSCAN) (this is an internal to how Narayana works).

      It would be beneficial provide an option that Narayana closes {{XAResource}}s at the end of the recovery cycle when Narayana does not plan to use it again.

      The idea is to check if the XAResource is AutoCloseable and if so then the XAResource is closed at the end of the recovery cycle processing.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                ochaloup Ondrej Chaloupka
                Reporter:
                ochaloup Ondrej Chaloupka
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: