use of org.mule.runtime.core.internal.processor.DelegateTransaction in project mule by mulesoft.
the class DelegateTransactionFactory method beginTransaction.
@Override
public Transaction beginTransaction(MuleContext muleContext) throws TransactionException {
DelegateTransaction delegateTransaction = new DelegateTransaction(muleContext);
delegateTransaction.begin();
return delegateTransaction;
}
use of org.mule.runtime.core.internal.processor.DelegateTransaction in project mule by mulesoft.
the class TransactionCoordination method bindTransaction.
public void bindTransaction(final Transaction transaction) throws TransactionException {
Transaction oldTx = transactions.get();
// special handling for transaction collection
if (oldTx != null && !(oldTx instanceof DelegateTransaction)) {
throw new IllegalTransactionStateException(CoreMessages.transactionAlreadyBound());
}
if (oldTx != null && oldTx instanceof DelegateTransaction) {
DelegateTransaction delegateTransaction = (DelegateTransaction) oldTx;
if (!delegateTransaction.supportsInnerTransaction(transaction)) {
throw new IllegalTransactionStateException(CoreMessages.transactionAlreadyBound());
}
return;
}
transactions.set(transaction);
logTransactionBound(transaction);
}
Aggregations