Package org.mycore.common
Class MCRTransactionHelper
java.lang.Object
org.mycore.common.MCRTransactionHelper
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
starts a new database transaction.static void
commits the database transaction.static boolean
static boolean
Is the transaction still alive?static void
forces the database transaction to roll back.static boolean
Determine whether the current resource transaction has been marked for rollback.
-
Constructor Details
-
MCRTransactionHelper
public MCRTransactionHelper()
-
-
Method Details
-
isDatabaseAccessEnabled
public static boolean isDatabaseAccessEnabled() -
commitTransaction
public static void commitTransaction()commits the database transaction. Commit is only done ifisTransactionActive()
returns true. -
rollbackTransaction
public static void rollbackTransaction()forces the database transaction to roll back. Roll back is only performed ifisTransactionActive()
returns true. -
isTransactionActive
public static boolean isTransactionActive()Is the transaction still alive?- Returns:
- true if the transaction is still alive
-
transactionRequiresRollback
public static boolean transactionRequiresRollback()Determine whether the current resource transaction has been marked for rollback.- Returns:
- boolean indicating whether the transaction has been marked for rollback
-
beginTransaction
public static void beginTransaction()starts a new database transaction.
-