org.objectweb.speedo.workingset.api
Interface TransactionItf

All Superinterfaces:
TransactionalWorkingSet, WorkingSet
All Known Subinterfaces:
EJBTransactionItf, JDOTransactionItf
All Known Implementing Classes:
AbstractTransaction, EJBTransactionImpl, JDOTransactionImpl

public interface TransactionItf
extends TransactionalWorkingSet

Defines the transaction concept. It offers - demarcation methods (begin, commit rollback) - status checking - management of the connection to the underlying data support

Author:
S.Chassande-Barrioz

Field Summary
 
Fields inherited from interface org.objectweb.perseus.persistence.api.TransactionalWorkingSet
CTX_ABORTED, CTX_ACTIVE_TRANSACTIONAL, CTX_COMMITTED, CTX_PREPARED, CTX_PREPARED_FAIL, CTX_PREPARED_OK
 
Fields inherited from interface org.objectweb.perseus.persistence.api.WorkingSet
CTX_ACTIVE, CTX_CLOSED, READ_INTENTION, UNKNOWN_INTENTION, WRITE_INTENTION
 
Method Summary
 void activate()
          It activates the working set.
 void begin()
          Starts the transaction.
 void commit()
          Commits the transaction.
 POManagerItf getPOManager()
           
 boolean getRollbackOnly()
           
 boolean isActive()
           
 boolean isManagedEnv()
          Indicates if the transaction environnement is managed.
 void rollback()
          Rolles back the transaction.
 java.lang.RuntimeException rollBackOnInternalError(java.lang.Exception e)
           
 void setConnectionHolder(ConnectionHolder ch)
          Assignes the connection holder.
 void setRollbackOnly()
          Marks the current transaction as rollback only.
 
Methods inherited from interface org.objectweb.perseus.persistence.api.TransactionalWorkingSet
getWSRollBackOnly, setWSRollBackOnly
 
Methods inherited from interface org.objectweb.perseus.persistence.api.WorkingSet
bind, clear, entries, getConnectionHolder, getOid2Entry, getStatus, getUserObject, getWSObjectSharing, getWSRestoreValues, getWSRetainValues, lookup, oids, setStatus, setWSObjectSharing, setWSRestoreValues, setWSRetainValues, unbind
 

Method Detail

isActive

boolean isActive()
Returns:
boolean value indicating if the transaction is active or not.

begin

void begin()
Starts the transaction.

Throws:
SpeedoRuntimeException - If the transaction is already started

commit

void commit()
Commits the transaction.

Throws:
SpeedoRuntimeException - If the commit process fails

rollback

void rollback()
Rolles back the transaction.

Throws:
SpeedoRuntimeException - If the rollback process fails

activate

void activate()
              throws PersistenceException
It activates the working set. This is used to delimit the begining of the working set.

Throws:
PersistenceException

isManagedEnv

boolean isManagedEnv()
Indicates if the transaction environnement is managed. If the 'false' value is returned then that means that a user transaction matches to a local transaction managed by speedo.


setConnectionHolder

void setConnectionHolder(ConnectionHolder ch)
Assignes the connection holder. The connection holder is able to allocate a connection to the underlying data support and to kept it until the working set / transaction end.


setRollbackOnly

void setRollbackOnly()
Marks the current transaction as rollback only. this means that the transaction cannot be committed


getRollbackOnly

boolean getRollbackOnly()
Returns:
the rollback only flag.

rollBackOnInternalError

java.lang.RuntimeException rollBackOnInternalError(java.lang.Exception e)

getPOManager

POManagerItf getPOManager()