Package com.arjuna.ats.jta.cdi
Class TransactionHandler
java.lang.Object
com.arjuna.ats.jta.cdi.TransactionHandler
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
endTransaction
(jakarta.transaction.TransactionManager tm, jakarta.transaction.Transaction tx, RunnableWithException afterEndTransaction) It finished the transaction.static void
handleExceptionNoThrow
(jakarta.transaction.Transactional transactional, Throwable t, jakarta.transaction.Transaction tx) For cases that the transaction should be marked for rollback ie.
-
Constructor Details
-
TransactionHandler
public TransactionHandler()
-
-
Method Details
-
handleExceptionNoThrow
public static void handleExceptionNoThrow(jakarta.transaction.Transactional transactional, Throwable t, jakarta.transaction.Transaction tx) throws IllegalStateException, jakarta.transaction.SystemException For cases that the transaction should be marked for rollback ie. whenRuntimeException
is thrown or whenError
is thrown or when the exception si marked inTransactional.rollbackOn()
thenTransaction.setRollbackOnly()
is invoked.- Throws:
IllegalStateException
jakarta.transaction.SystemException
-
endTransaction
public static void endTransaction(jakarta.transaction.TransactionManager tm, jakarta.transaction.Transaction tx, RunnableWithException afterEndTransaction) throws Exception It finished the transaction.
Call
TransactionManager.rollback()
when the transaction si marked forStatus.STATUS_MARKED_ROLLBACK
. otherwise the transaction is committed. Either way there is executed theRunnable
'afterEndTransaction' after the transaction is finished.- Throws:
Exception
-