public class PseudoTransactionService.MyTransaction extends java.lang.Object implements Transaction
Constructor and Description |
---|
MyTransaction() |
Modifier and Type | Method and Description |
---|---|
void |
commit()
Complete the transaction represented by this Transaction object.
|
boolean |
delistResource(javax.transaction.xa.XAResource xaRes,
int flag)
Disassociate the resource specified from the transaction associated
with the target Transaction object.
|
boolean |
enlistResource(javax.transaction.xa.XAResource xaRes)
Enlist the resource specified with the transaction associated with the
target Transaction object.
|
java.lang.Object |
getResource(java.lang.Object key) |
boolean |
getRollbackOnly() |
int |
getStatus()
Obtain the status of the transaction associated with the target
Transaction object.
|
void |
putResource(java.lang.Object key,
java.lang.Object value) |
void |
registerInterposedSynchronization(Synchronization synchronization) |
void |
registerSynchronization(Synchronization synchronization)
Register a synchronization object for the transaction currently
associated with the target object.
|
void |
rollback()
Rollback the transaction represented by this Transaction object.
|
void |
setRollbackOnly()
Modify the transaction associated with the target object such that
the only possible outcome of the transaction is to roll back the
transaction.
|
public boolean delistResource(javax.transaction.xa.XAResource xaRes, int flag)
Transaction
delistResource
in interface Transaction
xaRes
- The XAResource object associated with the resource
(connection).flag
- One of the values of TMSUCCESS, TMSUSPEND, or TMFAIL.public boolean enlistResource(javax.transaction.xa.XAResource xaRes)
Transaction
enlistResource
in interface Transaction
xaRes
- The XAResource object associated with the resource
(connection).public int getStatus()
Transaction
getStatus
in interface Transaction
public void registerSynchronization(Synchronization synchronization)
Transaction
registerSynchronization
in interface Transaction
synchronization
- The Synchronization object for the transaction associated
with the target object.public void registerInterposedSynchronization(Synchronization synchronization)
public boolean getRollbackOnly()
public void setRollbackOnly()
Transaction
setRollbackOnly
in interface Transaction
public java.lang.Object getResource(java.lang.Object key)
public void putResource(java.lang.Object key, java.lang.Object value)
public void commit() throws RollbackException
Transaction
commit
in interface Transaction
RollbackException
- Thrown to indicate that
the transaction has been rolled back rather than committed.public void rollback()
Transaction
rollback
in interface Transaction