org.ujorm.orm
Class Transaction

java.lang.Object
  extended by org.ujorm.orm.Transaction
All Implemented Interfaces:
Transaction

public final class Transaction
extends Object
implements Transaction

Transaction manager.


Method Summary
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isRoot

public boolean isRoot()
Returns true, if the transactioni the ROOT.


commit

public void commit()
            throws IllegalStateException
Commit the current level of the beginTransaction.

Specified by:
commit in interface Transaction
Throws:
IllegalStateException

rollback

public void rollback()
              throws IllegalStateException
Rollback the current level of the beginTransaction.

Specified by:
rollback in interface Transaction
Throws:
IllegalStateException

nestedTransaction

public Transaction nestedTransaction()
Create a nested transaction


getSession

public Session getSession()
Get the current Session.

Returns:
Not null values

delistResource

public boolean delistResource(XAResource xaRes,
                              int flag)
                       throws IllegalStateException

Specified by:
delistResource in interface Transaction
Throws:
IllegalStateException

enlistResource

public boolean enlistResource(XAResource xaRes)
                       throws IllegalStateException

Specified by:
enlistResource in interface Transaction
Throws:
IllegalStateException

registerSynchronization

public void registerSynchronization(Synchronization sync)
                             throws IllegalStateException

Specified by:
registerSynchronization in interface Transaction
Throws:
IllegalStateException

setRollbackOnly

public void setRollbackOnly()
Rollback transaction only, default value is false

Specified by:
setRollbackOnly in interface Transaction

getStatus

public int getStatus()
JTA Status

Specified by:
getStatus in interface Transaction


Copyright 2013, Pavel Ponec