use of org.jboss.as.test.integration.transactions.PersistentTestXAResource in project wildfly by wildfly.
the class TransactionalBean method intermittentCommitFailureTwoPhase.
@TransactionAttribute(TransactionAttributeType.MANDATORY)
public void intermittentCommitFailureTwoPhase() {
try {
Transaction txn = tm.getTransaction();
log.debugf("Invocation to #intermittentCommitFailure with transaction: %s", txn);
txn.enlistResource(new TestCommitFailureXAResource(transactionCheckerSingleton));
txn.enlistResource(new PersistentTestXAResource(transactionCheckerSingleton));
} catch (Exception e) {
throw new IllegalStateException("Cannot enlist one of the XAResources " + TestCommitFailureXAResource.class.getSimpleName() + " or " + PersistentTestXAResource.class.getSimpleName() + " to the transaction", e);
}
}
use of org.jboss.as.test.integration.transactions.PersistentTestXAResource in project wildfly by wildfly.
the class TransactionalBean method enlistOnePersistentXAResource.
@TransactionAttribute(TransactionAttributeType.MANDATORY)
public void enlistOnePersistentXAResource() {
try {
log.debugf("Invocation to #enlistOnePersistentXAResource with transaction", tm.getTransaction());
tm.getTransaction().enlistResource(new PersistentTestXAResource(transactionCheckerSingleton));
} catch (Exception e) {
throw new IllegalStateException("Cannot enlist single " + PersistentTestXAResource.class.getSimpleName() + " to transaction", e);
}
}
use of org.jboss.as.test.integration.transactions.PersistentTestXAResource in project wildfly by wildfly.
the class TestXAResourceRecoveryHelper method postConstruct.
/**
* Singleton lifecycle method.
* Register the recovery module with the transaction manager.
*/
@PostConstruct
public void postConstruct() {
log.debug("TestXAResourceRecoveryHelper starting");
this.testXaResourceInstance = new TestXAResource(transactionCheckerSingleton);
this.persistentTestXaResourceInstance = new PersistentTestXAResource(transactionCheckerSingleton);
getRecoveryModule().addXAResourceRecoveryHelper(this);
}
Aggregations