use of org.mule.runtime.core.internal.transaction.ExternalXaTransaction in project mule by mulesoft.
the class XaTransactionFactory method joinExternalTransaction.
/**
* Create a Mule transaction that represents a transaction started outside of Mule
*/
public Transaction joinExternalTransaction(MuleContext muleContext) throws TransactionException {
try {
TransactionManager txManager = muleContext.getTransactionManager();
if (txManager.getTransaction() == null) {
return null;
}
XaTransaction xat = new ExternalXaTransaction(muleContext);
xat.begin();
return xat;
} catch (Exception e) {
throw new TransactionException(CoreMessages.cannotStartTransaction("XA"), e);
}
}
Aggregations