[jbossts-issues] [JBoss JIRA] (JBTM-3325) Create a way to close XAResource at the end of the recovery cycle processing

Ondrej Chaloupka (Jira) issues at jboss.org
Mon Jun 22 10:05:06 EDT 2020


    [ https://issues.redhat.com/browse/JBTM-3325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14170803#comment-14170803 ] 

Ondrej Chaloupka commented on JBTM-3325:
----------------------------------------

I'm leaving this task for further discussion as there is currently no resolution found based on the https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!topic/narayana-users/v4Mr__BTliQ

I would need more details from [~lbarreiro] what are his expectations about integration.
>From what [~jhalliday] explained the call of {{XAResource.recover(TMENDRSCAN)}} does not mean there is no more work done with the XAResource. The recovery modules can share the {{XAResource}} and when the {{XARecoveryModule}} finishes its work there still could be other modules touching the resource. If the {{TMENDRSCAN}} means closing the underlaying connection it could mean the following module fails to do its work as the XAResource is already "closed".

Some different approach like some hook for the end of the recovery cycle could be considered but currently it's not clear to me if it's what is needed.

> Create a way to close XAResource at the end of the recovery cycle processing
> ----------------------------------------------------------------------------
>
>                 Key: JBTM-3325
>                 URL: https://issues.redhat.com/browse/JBTM-3325
>             Project: JBoss Transaction Manager
>          Issue Type: Enhancement
>          Components: JTA
>    Affects Versions: 5.10.5.Final
>            Reporter: Ondrej Chaloupka
>            Assignee: Ondrej Chaloupka
>            Priority: Major
>
> 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.



--
This message was sent by Atlassian Jira
(v7.13.8#713008)


More information about the jbossts-issues mailing list