|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.easybeans.persistence.TxEntityManagerLifeCycle
public class TxEntityManagerLifeCycle
This class manages the lifecycle of an entity manager with transaction scoped persistence context. It means that it should be closed when the transaction is committed or rollbacked.
Field Summary | |
---|---|
private EntityManager |
entityManager
Entity manager that is referenced. |
private javax.transaction.Transaction |
tx
Tx's association to release. |
private TxEntityManagerHandler |
txEntityManagerHandler
Handler that manages tx entity manager (to release the tx). |
Constructor Summary | |
---|---|
TxEntityManagerLifeCycle(EntityManager entityManager,
javax.transaction.Transaction tx,
TxEntityManagerHandler txEntityManagerHandler)
|
Method Summary | |
---|---|
void |
afterCompletion(int status)
This method is called by the transaction manager after the transaction is committed or rolled back. |
void |
beforeCompletion()
The beforeCompletion method is called by the transaction manager prior to the start of the two-phase transaction commit process. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private EntityManager entityManager
private TxEntityManagerHandler txEntityManagerHandler
private javax.transaction.Transaction tx
Constructor Detail |
---|
public TxEntityManagerLifeCycle(EntityManager entityManager, javax.transaction.Transaction tx, TxEntityManagerHandler txEntityManagerHandler)
entityManager
- Entity manager that is managed (lifecycle).tx
- the transaction that needs to be released in the handler.txEntityManagerHandler
- handler on which release association with TXMethod Detail |
---|
public void beforeCompletion()
beforeCompletion
in interface javax.transaction.Synchronization
public void afterCompletion(int status)
afterCompletion
in interface javax.transaction.Synchronization
status
- The status of the transaction completion.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |