Class JtaStatusHelper
- java.lang.Object
-
- org.hibernate.engine.transaction.internal.jta.JtaStatusHelper
-
public final class JtaStatusHelper extends Object
Utility for dealing with JTA statuses.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intgetStatus(jakarta.transaction.TransactionManager transactionManager)Extract the status code from the currentTransactionassociated with the givenTransactionManagerstatic intgetStatus(jakarta.transaction.UserTransaction userTransaction)Extract the status code from aUserTransactionstatic booleanisActive(int status)Does the given status code indicate an active transaction?static booleanisActive(jakarta.transaction.TransactionManager transactionManager)Does the status code obtained from the givenTransactionManagerindicate an active transaction?static booleanisActive(jakarta.transaction.UserTransaction userTransaction)Does the status code obtained from the givenUserTransactionindicate an active transaction?static booleanisCommitted(int status)Does the given status code indicate a committed transaction?static booleanisCommitted(jakarta.transaction.TransactionManager transactionManager)Does the status code obtained from the givenTransactionManagerindicate a commit?static booleanisCommitted(jakarta.transaction.UserTransaction userTransaction)Does the status code obtained from the givenUserTransactionindicate a commit?static booleanisMarkedForRollback(int status)Does the given status code indicate the transaction has been marked for rollback?static booleanisRollback(int status)Does the given status code indicate a rolled back transaction?static booleanisRollback(jakarta.transaction.TransactionManager transactionManager)Does the status code obtained from the givenTransactionManagerindicate a roll back?static booleanisRollback(jakarta.transaction.UserTransaction userTransaction)Does the status code obtained from the givenUserTransactionindicate a roll back?
-
-
-
Method Detail
-
getStatus
public static int getStatus(jakarta.transaction.UserTransaction userTransaction)
Extract the status code from aUserTransaction- Parameters:
userTransaction- TheUserTransactionfrom which to extract the status.- Returns:
- The transaction status
- Throws:
TransactionException- If theUserTransactionreports the status as unknown
-
getStatus
public static int getStatus(jakarta.transaction.TransactionManager transactionManager)
Extract the status code from the currentTransactionassociated with the givenTransactionManager- Parameters:
transactionManager- TheTransactionManagerfrom which to extract the status.- Returns:
- The transaction status
- Throws:
TransactionException- If theTransactionManagerreports the status as unknown
-
isActive
public static boolean isActive(int status)
Does the given status code indicate an active transaction?- Parameters:
status- The transaction status code to check- Returns:
- True if the code indicates active; false otherwise.
-
isActive
public static boolean isActive(jakarta.transaction.UserTransaction userTransaction)
Does the status code obtained from the givenUserTransactionindicate an active transaction?- Parameters:
userTransaction- TheUserTransactionwhose status is to be checked- Returns:
- True if the transaction is active; false otherwise.
-
isActive
public static boolean isActive(jakarta.transaction.TransactionManager transactionManager)
Does the status code obtained from the givenTransactionManagerindicate an active transaction?- Parameters:
transactionManager- TheTransactionManagerwhose status is to be checked- Returns:
- True if the transaction is active; false otherwise.
-
isRollback
public static boolean isRollback(int status)
Does the given status code indicate a rolled back transaction?- Parameters:
status- The transaction status code to check- Returns:
- True if the code indicates a roll back; false otherwise.
-
isRollback
public static boolean isRollback(jakarta.transaction.UserTransaction userTransaction)
Does the status code obtained from the givenUserTransactionindicate a roll back?- Parameters:
userTransaction- TheUserTransactionwhose status is to be checked- Returns:
- True if the transaction indicates roll back; false otherwise.
-
isRollback
public static boolean isRollback(jakarta.transaction.TransactionManager transactionManager)
Does the status code obtained from the givenTransactionManagerindicate a roll back?- Parameters:
transactionManager- TheTransactionManagerwhose status is to be checked- Returns:
- True if the transaction indicates roll back; false otherwise.
-
isCommitted
public static boolean isCommitted(int status)
Does the given status code indicate a committed transaction?- Parameters:
status- The transaction status code to check- Returns:
- True if the code indicates a roll back; false otherwise.
-
isCommitted
public static boolean isCommitted(jakarta.transaction.UserTransaction userTransaction)
Does the status code obtained from the givenUserTransactionindicate a commit?- Parameters:
userTransaction- TheUserTransactionwhose status is to be checked- Returns:
- True if the transaction indicates commit; false otherwise.
-
isCommitted
public static boolean isCommitted(jakarta.transaction.TransactionManager transactionManager)
Does the status code obtained from the givenTransactionManagerindicate a commit?- Parameters:
transactionManager- TheTransactionManagerwhose status is to be checked- Returns:
- True if the transaction indicates commit; false otherwise.
-
isMarkedForRollback
public static boolean isMarkedForRollback(int status)
Does the given status code indicate the transaction has been marked for rollback?- Parameters:
status- The transaction status code to check- Returns:
- True if the code indicates a roll back; false otherwise.
-
-