public class TransactionUtil extends Object
Constructor and Description |
---|
TransactionUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
getEntityManagerDetails(javax.persistence.EntityManager manager) |
static Transaction |
getTransaction() |
static TransactionManager |
getTransactionManager() |
static javax.persistence.EntityManager |
getTransactionScopedEntityManager(String puScopedName)
Get current persistence context.
|
static TransactionSynchronizationRegistry |
getTransactionSynchronizationRegistry() |
static boolean |
isInTx() |
static void |
putEntityManagerInTransactionRegistry(String scopedPuName,
javax.persistence.EntityManager entityManager)
Save the specified EntityManager in the local threads active transaction.
|
static void |
registerExtendedUnderlyingWithTransaction(String scopedPuName,
javax.persistence.EntityManager xpc,
javax.persistence.EntityManager underlyingEntityManager)
Register the specified entity manager (persistence context) with the current transaction.
|
static void |
registerSynchronization(javax.persistence.EntityManager entityManager,
String puScopedName) |
static void |
setTransactionManager(TransactionManager tm) |
static void |
setTransactionSynchronizationRegistry(TransactionSynchronizationRegistry transactionSynchronizationRegistry) |
public static void setTransactionManager(TransactionManager tm)
public static TransactionManager getTransactionManager()
public static void setTransactionSynchronizationRegistry(TransactionSynchronizationRegistry transactionSynchronizationRegistry)
public static boolean isInTx()
public static void registerExtendedUnderlyingWithTransaction(String scopedPuName, javax.persistence.EntityManager xpc, javax.persistence.EntityManager underlyingEntityManager)
scopedPuName
- is the fully (application deployment) scoped name of persistence unitxpc
- is the entity manager (a org.jboss.as.jpa class) to registerunderlyingEntityManager
- is the underlying entity manager obtained from the persistence providerpublic static javax.persistence.EntityManager getTransactionScopedEntityManager(String puScopedName)
puScopedName
- public static void registerSynchronization(javax.persistence.EntityManager entityManager, String puScopedName)
public static Transaction getTransaction()
public static TransactionSynchronizationRegistry getTransactionSynchronizationRegistry()
public static String getEntityManagerDetails(javax.persistence.EntityManager manager)
public static void putEntityManagerInTransactionRegistry(String scopedPuName, javax.persistence.EntityManager entityManager)
scopedPuName
- entityManager
- Copyright © 2013 JBoss by Red Hat. All rights reserved.