Jonathan Halliday commented on JBTM-353:
XAResourceRecovery instances are loaded by XARecoveryModule, which is loaded at startup.
The XARecoveryModule setup code is the only thing that calls initialize on
XAResourceRecovery instances. It does so only once. After that each recovery pass calls
hasMoreResources/getXAResource. But nothing ever resets the 'iterator', so
that's only meaninfgul on the first recovery pass. Thereafter, for the remaining life
of the classloader, hasMoreResources will return false. Thus if the initial recovery pass
fails for some reason, it won't be retried.
XAResourceRecovery has wrong conceptual model
Project: JBoss Transaction Manager
Issue Type: Task
Security Level: Public(Everyone can see)
Affects Versions: 4.3.0.GA
Reporter: Jonathan Halliday
Assigned To: Jonathan Halliday
Fix For: 4.4.CR1
XAResourceRecovery is based on an iterator model:
public boolean initialise (String p) throws SQLException;
public boolean hasMoreResources ();
public XAResource getXAResource () throws SQLException;
However, XAResourceRecovery instances are created once at recovery manager startup. This
means there is only ever one recovery pass that actually returns resources. On later
passes the iterator is exhausted and returns nothing. This is the wrong model. XAResources
are not individual entities in need of recovery. Rather they are entities from which a
list of Xids in need of recovery can be retrieved. If the configuration of the underlying
system does not change, the set of XAResources should remain constant over time, being one
per known resource manager. On each recovery pass the list of in-doubt Xids returned by a
recover scan on that resource many change.
The model should change to follow that used by JCA ResourceAdapter:
public XAResource getXAResources()
The recovery pass would then obtain and walk the array rather than using the current
Additionally the exception types should be more generic. SQLException assumes the
resource manager is a db, which may not be the case.
This will also impact the recovery examples, which implement this interface.
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see: http://www.atlassian.com/software/jira