- java.lang.Object
-
- org.datanucleus.transaction.TransactionUtils
-
public class TransactionUtils extends Object
Utility methods relating to transactions.
-
-
Constructor Summary
Constructors Constructor Description TransactionUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
getNameForTransactionIsolationLevel(int isolation)
Accessor for a string name of a transaction isolation level.static String
getTransactionIsolationForStoreManager(StoreManager storeMgr, String transactionIsolation)
Method to return the transaction isolation level that will be used for the provided StoreManager bearing in mind the specified level the user requested.static int
getTransactionIsolationLevelForName(String isolationName)
Convenience method to convert the supplied isolation level name into the associated UserTransaction type number.
-
-
-
Method Detail
-
getTransactionIsolationForStoreManager
public static String getTransactionIsolationForStoreManager(StoreManager storeMgr, String transactionIsolation)
Method to return the transaction isolation level that will be used for the provided StoreManager bearing in mind the specified level the user requested.- Parameters:
storeMgr
- The Store ManagertransactionIsolation
- Requested isolation level- Returns:
- Isolation level to use
- Throws:
TransactionIsolationNotSupportedException
- When no suitable level available given the requested level
-
getNameForTransactionIsolationLevel
public static String getNameForTransactionIsolationLevel(int isolation)
Accessor for a string name of a transaction isolation level.- Parameters:
isolation
- The isolation level (as defined by UserTransaction).- Returns:
- The name
-
getTransactionIsolationLevelForName
public static int getTransactionIsolationLevelForName(String isolationName)
Convenience method to convert the supplied isolation level name into the associated UserTransaction type number.- Parameters:
isolationName
- The name of the isolation level- Returns:
- Isolation level type
-
-