Package com.arjuna.ats.jta.cdi
Class TransactionHandler
java.lang.Object
com.arjuna.ats.jta.cdi.TransactionHandler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidendTransaction(jakarta.transaction.TransactionManager tm, jakarta.transaction.Transaction tx, RunnableWithException afterEndTransaction) It finished the transaction.static voidhandleExceptionNoThrow(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. whenRuntimeExceptionis thrown or whenErroris thrown or when the exception si marked inTransactional.rollbackOn()thenTransaction.setRollbackOnly()is invoked.- Throws:
IllegalStateExceptionjakarta.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
-