sf logo

sf.qof.session
Class SessionContextFactory.DefaultUserTransaction

java.lang.Object
  extended by sf.qof.session.SessionContextFactory.DefaultUserTransaction
All Implemented Interfaces:
UserTransaction
Enclosing class:
SessionContextFactory

protected static class SessionContextFactory.DefaultUserTransaction
extends Object
implements UserTransaction

Internal implementation of UserTransaction.


Constructor Summary
SessionContextFactory.DefaultUserTransaction(Connection connection)
          Constructs a DefaultUserTransaction object.
 
Method Summary
 void begin()
          Create a new transaction and associate it with the current thread.
 void close()
          Closes the transaction.
 void commit()
          Complete the transaction associated with the current thread.
 boolean isRollbackOnly()
          Returns true if the only possible outcome of the transaction that is associated with the current thread is to roll back the transaction.
 void rollback()
          Roll back the transaction associated with the current thread.
 void setRollbackOnly()
          Modify the transaction associated with the current thread such that the only possible outcome of the transaction is to roll back the transaction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionContextFactory.DefaultUserTransaction

public SessionContextFactory.DefaultUserTransaction(Connection connection)
Constructs a DefaultUserTransaction object.

Parameters:
connection - the current database connection
Method Detail

begin

public void begin()
           throws SystemException
Description copied from interface: UserTransaction
Create a new transaction and associate it with the current thread.

Specified by:
begin in interface UserTransaction
Throws:
SystemException - Thrown if the transaction manager encounters an unexpected error condition.

commit

public void commit()
            throws SystemException,
                   RollbackException
Description copied from interface: UserTransaction
Complete the transaction associated with the current thread. When this method completes, the thread is no longer associated with a transaction.

Specified by:
commit in interface UserTransaction
Throws:
SystemException - Thrown if the transaction manager encounters an unexpected error condition.
RollbackException - Thrown to indicate that the transaction has been rolled back rather than committed.

isRollbackOnly

public boolean isRollbackOnly()
Description copied from interface: UserTransaction
Returns true if the only possible outcome of the transaction that is associated with the current thread is to roll back the transaction.

Specified by:
isRollbackOnly in interface UserTransaction
Returns:
true if current transaction can only be rolled back

rollback

public void rollback()
              throws SystemException
Description copied from interface: UserTransaction
Roll back the transaction associated with the current thread. When this method completes, the thread is no longer associated with a transaction.

Specified by:
rollback in interface UserTransaction
Throws:
SystemException - Thrown if the transaction manager encounters an unexpected error condition.

setRollbackOnly

public void setRollbackOnly()
                     throws SystemException
Description copied from interface: UserTransaction
Modify the transaction associated with the current thread such that the only possible outcome of the transaction is to roll back the transaction.

Specified by:
setRollbackOnly in interface UserTransaction
Throws:
SystemException - Thrown if the transaction manager encounters an unexpected error condition.

close

public void close()
Closes the transaction.


sf logo

Copyright © 2007 brunella ltd. All Rights Reserved.