Search in sources :

Example 1 with PersistentXaTransactionContext

use of org.mule.runtime.core.internal.util.queue.PersistentXaTransactionContext in project mule by mulesoft.

the class XaTransactionRecoverer method commitDandlingTransaction.

public void commitDandlingTransaction(Xid xid, boolean onePhase) throws XAException {
    try {
        logger.info("Commiting dangling tx with id " + xid);
        new PersistentXaTransactionContext(xaTxQueueTransactionJournal, queueProvider, xid).doCommit();
    } catch (ResourceManagerException e) {
        logger.warn(e.getMessage());
        if (logger.isDebugEnabled()) {
            logger.debug("Error committing dangling transaction", e);
        }
        throw new XAException(XAException.XAER_NOTA);
    }
}
Also used : XAException(javax.transaction.xa.XAException) PersistentXaTransactionContext(org.mule.runtime.core.internal.util.queue.PersistentXaTransactionContext) ResourceManagerException(org.mule.runtime.core.api.transaction.xa.ResourceManagerException)

Example 2 with PersistentXaTransactionContext

use of org.mule.runtime.core.internal.util.queue.PersistentXaTransactionContext in project mule by mulesoft.

the class XaTransactionRecoverer method rollbackDandlingTransaction.

public void rollbackDandlingTransaction(Xid xid) throws XAException {
    try {
        logger.info("Rollbacking dangling tx with id " + xid);
        new PersistentXaTransactionContext(xaTxQueueTransactionJournal, queueProvider, xid).doRollback();
    } catch (ResourceManagerException e) {
        logger.warn(e.getMessage());
        if (logger.isDebugEnabled()) {
            logger.debug("Error rollbacking dangling transaction", e);
        }
        throw new XAException(XAException.XAER_NOTA);
    }
}
Also used : XAException(javax.transaction.xa.XAException) PersistentXaTransactionContext(org.mule.runtime.core.internal.util.queue.PersistentXaTransactionContext) ResourceManagerException(org.mule.runtime.core.api.transaction.xa.ResourceManagerException)

Aggregations

XAException (javax.transaction.xa.XAException)2 ResourceManagerException (org.mule.runtime.core.api.transaction.xa.ResourceManagerException)2 PersistentXaTransactionContext (org.mule.runtime.core.internal.util.queue.PersistentXaTransactionContext)2