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, serializeRead
TRANSACTION_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()
Method to commit the transaction.
|
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()
Method to rollback the transaction.
|
void |
setRollbackOnly()
Mutator for the "rollback only" flag.
|
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, setSynchronization
protected org.datanucleus.JTATransactionImpl.JoinStatus joinStatus
protected boolean autoJoin
public boolean isJoined()
public void joinTransaction()
public boolean getIsActive()
TransactionImpl
getIsActive
in interface Transaction
getIsActive
in class TransactionImpl
public 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 Transaction
isActive
in class TransactionImpl
public void begin()
begin
in interface Transaction
begin
in class TransactionImpl
public void commit()
TransactionImpl
commit
in interface Transaction
commit
in class TransactionImpl
public void rollback()
TransactionImpl
rollback
in interface Transaction
rollback
in class TransactionImpl
public void setRollbackOnly()
TransactionImpl
setRollbackOnly
in interface Transaction
setRollbackOnly
in class TransactionImpl
public void beforeCompletion()
beforeCompletion
in interface Synchronization
public void afterCompletion(int status)
afterCompletion
in interface Synchronization
status
- The statusCopyright © 2020. All rights reserved.