Top Description Constructors Methods
org.hibernate.engine.transaction.internal.jta

public final Class JtaStatusHelper

extends Object
Class Inheritance
Imports
jakarta.transaction.Status, .SystemException, .TransactionManager, .UserTransaction, org.hibernate.TransactionException

Utility for dealing with JTA statuses.
Author
Steve Ebersole

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static int

Returns:

The transaction status
getStatus
(UserTransaction
The UserTransaction from which to extract the status.
userTransaction
)

Extract the status code from a UserTransaction

public static int

Returns:

The transaction status
getStatus
(TransactionManager
The TransactionManager from which to extract the status.
transactionManager
)

Extract the status code from the current jakarta.transaction.Transaction associated with the given TransactionManager

public static boolean

Returns:

True if the code indicates active; false otherwise.
isActive
(int
The transaction status code to check
status
)

Does the given status code indicate an active transaction?

public static boolean

Returns:

True if the transaction is active; false otherwise.
isActive
(UserTransaction
The UserTransaction whose status is to be checked
userTransaction
)

Does the status code obtained from the given UserTransaction indicate an active transaction?

public static boolean

Returns:

True if the transaction is active; false otherwise.
isActive
(TransactionManager
The TransactionManager whose status is to be checked
transactionManager
)

Does the status code obtained from the given TransactionManager indicate an active transaction?

public static boolean

Returns:

True if the code indicates a roll back; false otherwise.
isCommitted
(int
The transaction status code to check
status
)

Does the given status code indicate a committed transaction?

public static boolean

Returns:

True if the transaction indicates commit; false otherwise.
isCommitted
(UserTransaction
The UserTransaction whose status is to be checked
userTransaction
)

Does the status code obtained from the given UserTransaction indicate a commit?

public static boolean

Returns:

True if the transaction indicates commit; false otherwise.
isCommitted
(TransactionManager
The TransactionManager whose status is to be checked
transactionManager
)

Does the status code obtained from the given TransactionManager indicate a commit?

public static boolean

Returns:

True if the code indicates a roll back; false otherwise.
isMarkedForRollback
(int
The transaction status code to check
status
)

Does the given status code indicate the transaction has been marked for rollback?

public static boolean

Returns:

True if the code indicates a roll back; false otherwise.
isRollback
(int
The transaction status code to check
status
)

Does the given status code indicate a rolled back transaction?

public static boolean

Returns:

True if the transaction indicates roll back; false otherwise.
isRollback
(UserTransaction
The UserTransaction whose status is to be checked
userTransaction
)

Does the status code obtained from the given UserTransaction indicate a roll back?

public static boolean

Returns:

True if the transaction indicates roll back; false otherwise.
isRollback
(TransactionManager
The TransactionManager whose status is to be checked
transactionManager
)

Does the status code obtained from the given TransactionManager indicate a roll back?

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

JtaStatusHelperback to summary
private JtaStatusHelper()

Method Detail

getStatusback to summary
public static int getStatus(UserTransaction userTransaction)

Extract the status code from a UserTransaction

Parameters
userTransaction:UserTransaction

The UserTransaction from which to extract the status.

Returns:int

The transaction status

Exceptions
TransactionException:
If the UserTransaction reports the status as unknown
getStatusback to summary
public static int getStatus(TransactionManager transactionManager)

Extract the status code from the current jakarta.transaction.Transaction associated with the given TransactionManager

Parameters
transactionManager:TransactionManager

The TransactionManager from which to extract the status.

Returns:int

The transaction status

Exceptions
TransactionException:
If the TransactionManager reports the status as unknown
isActiveback to summary
public static boolean isActive(int status)

Does the given status code indicate an active transaction?

Parameters
status:int

The transaction status code to check

Returns:boolean

True if the code indicates active; false otherwise.

isActiveback to summary
public static boolean isActive(UserTransaction userTransaction)

Does the status code obtained from the given UserTransaction indicate an active transaction?

Parameters
userTransaction:UserTransaction

The UserTransaction whose status is to be checked

Returns:boolean

True if the transaction is active; false otherwise.

isActiveback to summary
public static boolean isActive(TransactionManager transactionManager)

Does the status code obtained from the given TransactionManager indicate an active transaction?

Parameters
transactionManager:TransactionManager

The TransactionManager whose status is to be checked

Returns:boolean

True if the transaction is active; false otherwise.

isCommittedback to summary
public static boolean isCommitted(int status)

Does the given status code indicate a committed transaction?

Parameters
status:int

The transaction status code to check

Returns:boolean

True if the code indicates a roll back; false otherwise.

isCommittedback to summary
public static boolean isCommitted(UserTransaction userTransaction)

Does the status code obtained from the given UserTransaction indicate a commit?

Parameters
userTransaction:UserTransaction

The UserTransaction whose status is to be checked

Returns:boolean

True if the transaction indicates commit; false otherwise.

isCommittedback to summary
public static boolean isCommitted(TransactionManager transactionManager)

Does the status code obtained from the given TransactionManager indicate a commit?

Parameters
transactionManager:TransactionManager

The TransactionManager whose status is to be checked

Returns:boolean

True if the transaction indicates commit; false otherwise.

isMarkedForRollbackback to summary
public static boolean isMarkedForRollback(int status)

Does the given status code indicate the transaction has been marked for rollback?

Parameters
status:int

The transaction status code to check

Returns:boolean

True if the code indicates a roll back; false otherwise.

Annotations
@SuppressWarnings:UnusedDeclaration
isRollbackback to summary
public static boolean isRollback(int status)

Does the given status code indicate a rolled back transaction?

Parameters
status:int

The transaction status code to check

Returns:boolean

True if the code indicates a roll back; false otherwise.

isRollbackback to summary
public static boolean isRollback(UserTransaction userTransaction)

Does the status code obtained from the given UserTransaction indicate a roll back?

Parameters
userTransaction:UserTransaction

The UserTransaction whose status is to be checked

Returns:boolean

True if the transaction indicates roll back; false otherwise.

isRollbackback to summary
public static boolean isRollback(TransactionManager transactionManager)

Does the status code obtained from the given TransactionManager indicate a roll back?

Parameters
transactionManager:TransactionManager

The TransactionManager whose status is to be checked

Returns:boolean

True if the transaction indicates roll back; false otherwise.