|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exolab.castor.persist.TransactionContext
org.exolab.castor.jdo.engine.TransactionContextImpl
final class TransactionContextImpl
A transaction context is required in order to perform operations
against the database. The transaction context is mapped to Transaction
for the ODMG API and into
XAResource
for XA databases. The only
way to begin a new transaction is through the creation of a new
transaction context. All database access must be performed through
a transaction context.
Field Summary |
---|
Fields inherited from class org.exolab.castor.persist.TransactionContext |
---|
OBJECT_STATE_HOLLOW, OBJECT_STATE_PERSISTENT, OBJECT_STATE_PERSISTENT_DELETED, OBJECT_STATE_PERSISTENT_NEW, OBJECT_STATE_PERSISTENT_NEW_DELETED, OBJECT_STATE_READ_ONLY, OBJECT_STATE_TRANSIENT |
Constructor Summary | |
---|---|
TransactionContextImpl(Database db,
boolean globalTx)
Create a new transaction context. |
Method Summary | |
---|---|
protected void |
closeConnections()
The derived class must implement this method and close all the connections used in this transaction. |
protected void |
commitConnections()
The derived class must implement this method and commit all the connections used in this transaction. |
java.lang.Object |
getConnection(LockEngine engine)
The derived class must implement this method and return an open connection for the specified engine. |
protected void |
rollbackConnections()
The derived class must implement this method and rollback all the connections used in this transaction. |
Methods inherited from class org.exolab.castor.persist.TransactionContext |
---|
addTxSynchronizable, close, commit, create, delete, fetch, getClassLoader, getDatabase, getIdentity, getLockTimeout, getObjectState, getScope, getStatus, getTransactionTimeout, getXid, isAutoStore, isDeleted, isDeletedByOID, isDepended, isOpen, isPersistent, isReadOnly, isRecorded, load, load, markCreate, markModified, markUpdate, prepare, query, query, release, removeTxSynchronizable, rollback, setAutoStore, setCallback, setInstanceFactory, setLockTimeout, setTransactionTimeout, softLock, txcommitted, txrolledback, update, writeLock |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TransactionContextImpl(Database db, boolean globalTx)
Method Detail |
---|
protected void commitConnections() throws TransactionAbortedException
TransactionContext
TransactionAbortedException
, causing a rollback to occur as
the next step.
commitConnections
in class TransactionContext
TransactionAbortedException
- The transaction could not
commit fully or partially and should be rolled backprotected void closeConnections() throws TransactionAbortedException
TransactionContext
closeConnections
in class TransactionContext
TransactionAbortedException
- The transaction could not
close all the connectionsprotected void rollbackConnections()
TransactionContext
rollbackConnections
in class TransactionContext
public java.lang.Object getConnection(LockEngine engine) throws PersistenceException
TransactionContext
getConnection
in class TransactionContext
engine
- The persistence engine
PersistenceException
- An error occured talking to the
persistence engine
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |