public final class TransactionHandler extends Object
| Constructor and Description |
|---|
TransactionHandler() |
| Modifier and Type | Method and Description |
|---|---|
static void |
endTransaction(TransactionManager tm,
Transaction tx,
RunnableWithException afterEndTransaction)
It finished the transaction.
|
static void |
handleExceptionNoThrow(Transactional transactional,
Throwable t,
Transaction tx)
For cases that the transaction should be marked for rollback
ie.
|
public static void handleExceptionNoThrow(Transactional transactional, Throwable t, Transaction tx) throws IllegalStateException, SystemException
RuntimeException is thrown or when Error is thrown
or when the exception si marked in Transactional.rollbackOn()
then Transaction.setRollbackOnly() is invoked.IllegalStateExceptionSystemExceptionpublic static void endTransaction(TransactionManager tm, Transaction tx, RunnableWithException afterEndTransaction) throws Exception
It finished the transaction.
Call TransactionManager.rollback() when the transaction si marked for Status.STATUS_MARKED_ROLLBACK.
otherwise the transaction is committed.
Either way there is executed the Runnable 'afterEndTransaction' after the transaction is finished.
ExceptionCopyright © 2022 JBoss by Red Hat. All rights reserved.