public final class Transaction extends Object implements Transaction
| Modifier and Type | Method and Description |
|---|---|
void |
commit()
Commit the current level of the beginTransaction.
|
boolean |
delistResource(XAResource xaRes,
int flag) |
boolean |
enlistResource(XAResource xaRes) |
Session |
getSession()
Get the current Session.
|
int |
getStatus()
JTA Status
|
boolean |
isRoot()
Returns true, if the transactioni the ROOT.
|
Transaction |
nestedTransaction()
Create a nested transaction
|
void |
registerSynchronization(Synchronization sync) |
void |
rollback()
Rollback the current level of the beginTransaction.
|
void |
setRollbackOnly()
Rollback transaction only, default value is
false |
public boolean isRoot()
public void commit()
throws IllegalStateException
commit in interface TransactionIllegalStateExceptionpublic void rollback()
throws IllegalStateException
rollback in interface TransactionIllegalStateExceptionpublic Transaction nestedTransaction()
public Session getSession()
public boolean delistResource(XAResource xaRes, int flag) throws IllegalStateException
delistResource in interface TransactionIllegalStateExceptionpublic boolean enlistResource(XAResource xaRes) throws IllegalStateException
enlistResource in interface TransactionIllegalStateExceptionpublic void registerSynchronization(Synchronization sync) throws IllegalStateException
registerSynchronization in interface TransactionIllegalStateExceptionpublic void setRollbackOnly()
falsesetRollbackOnly in interface Transactionpublic int getStatus()
getStatus in interface TransactionCopyright 2013, Pavel Ponec