Package org.frankframework.jta.narayana
Class DataSourceXAResourceRecoveryHelper
java.lang.Object
org.frankframework.jta.narayana.DataSourceXAResourceRecoveryHelper
- All Implemented Interfaces:
com.arjuna.ats.jta.recovery.XAResourceRecoveryHelper,XAResource,org.jboss.tm.XAResourceWrapper
public class DataSourceXAResourceRecoveryHelper
extends Object
implements com.arjuna.ats.jta.recovery.XAResourceRecoveryHelper, XAResource, org.jboss.tm.XAResourceWrapper
XAResourceRecoveryHelper implementation which gets XIDs, which needs to be recovered, from the database.
See org.springframework.boot.jta.narayana.DataSourceXAResourceRecoveryHelper.
This class has been extended with a ConnectionManager to ensure operations can succeed. This has been copied from the JmsXAResourceRecoveryHelper.
Required as we wrap the connection in a pooling-capable factory, and do not use the native Narayana connection factory.
Additionally, this also implements `XAResourceWrapper`, which (AFAIK) only adds debug info. See XAResourceRecord#getJndiName()
- Author:
- Gytis Trikleris, Niels Meijer
-
Field Summary
Fields inherited from interface javax.transaction.xa.XAResource
TMENDRSCAN, TMFAIL, TMJOIN, TMNOFLAGS, TMONEPHASE, TMRESUME, TMSTARTRSCAN, TMSUCCESS, TMSUSPEND, XA_OK, XA_RDONLY -
Constructor Summary
ConstructorsConstructorDescriptionDataSourceXAResourceRecoveryHelper(XADataSource xaDataSource, String name) Create a newDataSourceXAResourceRecoveryHelperinstance. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidintIf Database connection was created successfully, returns an array with one instance of DataSourceXAResourceRecoveryHelper.booleaninitialise(String properties) booleanisSameRM(XAResource xaResource) intXid[]recover(int flag) voidbooleansetTransactionTimeout(int seconds) void
-
Constructor Details
-
DataSourceXAResourceRecoveryHelper
Create a newDataSourceXAResourceRecoveryHelperinstance.- Parameters:
xaDataSource- the XA data source
-
-
Method Details
-
initialise
- Specified by:
initialisein interfacecom.arjuna.ats.jta.recovery.XAResourceRecoveryHelper
-
getXAResources
If Database connection was created successfully, returns an array with one instance of DataSourceXAResourceRecoveryHelper. Otherwise, returns an empty array.- Specified by:
getXAResourcesin interfacecom.arjuna.ats.jta.recovery.XAResourceRecoveryHelper- Returns:
- Array with one instance of DataSourceXAResourceRecoveryHelper or an empty array
-
recover
- Specified by:
recoverin interfaceXAResource- Throws:
XAException
-
start
- Specified by:
startin interfaceXAResource- Throws:
XAException
-
end
- Specified by:
endin interfaceXAResource- Throws:
XAException
-
prepare
- Specified by:
preparein interfaceXAResource- Throws:
XAException
-
commit
- Specified by:
commitin interfaceXAResource- Throws:
XAException
-
rollback
- Specified by:
rollbackin interfaceXAResource- Throws:
XAException
-
isSameRM
- Specified by:
isSameRMin interfaceXAResource- Throws:
XAException
-
forget
- Specified by:
forgetin interfaceXAResource- Throws:
XAException
-
getTransactionTimeout
- Specified by:
getTransactionTimeoutin interfaceXAResource- Throws:
XAException
-
setTransactionTimeout
- Specified by:
setTransactionTimeoutin interfaceXAResource- Throws:
XAException
-
getResource
- Specified by:
getResourcein interfaceorg.jboss.tm.XAResourceWrapper
-
getProductName
- Specified by:
getProductNamein interfaceorg.jboss.tm.XAResourceWrapper
-
getProductVersion
- Specified by:
getProductVersionin interfaceorg.jboss.tm.XAResourceWrapper
-
getJndiName
- Specified by:
getJndiNamein interfaceorg.jboss.tm.XAResourceWrapper
-