public class JTATransactionImpl extends TransactionImpl implements Synchronization
joinTransactionwhich will check the current join status and join as necessary.
When this transaction is being used the transactions must be controlled using javax.transaction.UserTransaction,
and not using local transactions (e.g PM.currentTransaction().begin()).
Should also work for SessionBeans, as per spec UserTransaction reflects SessionBean-based tx demarcation.
See also Transaction
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
autoJoin |
protected org.datanucleus.JTATransactionImpl.JoinStatus |
joinStatus |
rollbackOnly, serializeReadTRANSACTION_ISOLATION_OPTION| Modifier and Type | Method and Description |
|---|---|
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.
|
void |
begin()
JDO spec "16.1.3 Stateless Session Bean with Bean Managed Transactions": "acquiring a PM without beginning a UserTransaction results
in the PM being able to manage transaction boundaries via begin, commit, and rollback methods on JDO Transaction.
|
void |
commit()
Allow UserTransaction demarcation
|
boolean |
getIsActive()
Similar to "isActive" except that it just returns the "active" flag whereas the isActive() method can also embody rejoining to underlying transactions.
|
boolean |
isActive()
Accessor for whether the transaction is active.
|
boolean |
isJoined() |
void |
joinTransaction()
Method to call if you want to join to the underlying UserTransaction.
|
void |
rollback()
Allow UserTransaction demarcation
|
void |
setRollbackOnly()
Allow UserTransaction demarcation
|
addTransactionEventListener, bindTransactionEventListener, close, end, flush, getBeginTime, getNontransactionalRead, getNontransactionalWrite, getNontransactionalWriteAutoCommit, getOptimistic, getOptions, getRestoreValues, getRetainValues, getRollbackOnly, getSerializeRead, getSynchronization, internalBegin, internalCommit, internalPostCommit, internalPreCommit, internalPreRollback, internalRollback, isCommitting, preFlush, releaseSavepoint, removeTransactionEventListener, rollbackToSavepoint, setNontransactionalRead, setNontransactionalWrite, setNontransactionalWriteAutoCommit, setOptimistic, setOption, setOption, setOption, setOption, setProperties, setRestoreValues, setRetainValues, setSavepoint, setSerializeRead, setSynchronizationprotected org.datanucleus.JTATransactionImpl.JoinStatus joinStatus
protected boolean autoJoin
public boolean isJoined()
public void joinTransaction()
public boolean getIsActive()
TransactionImplgetIsActive in interface TransactiongetIsActive in class TransactionImplpublic boolean isActive()
Status.STATUS_NO_TRANSACTION, i.e. when the current thread is associated with a
JTA transaction. Note that this will attempt to join if not yet joinedisActive in interface TransactionisActive in class TransactionImplpublic void begin()
begin in interface Transactionbegin in class TransactionImplpublic void commit()
commit in interface Transactioncommit in class TransactionImplpublic void rollback()
rollback in interface Transactionrollback in class TransactionImplpublic void setRollbackOnly()
setRollbackOnly in interface TransactionsetRollbackOnly in class TransactionImplpublic void beforeCompletion()
beforeCompletion in interface Synchronizationpublic void afterCompletion(int status)
afterCompletion in interface Synchronizationstatus - The statusCopyright © 2019. All rights reserved.