|
|||||||||
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
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.
Nested Class Summary |
Nested classes inherited from class org.exolab.castor.persist.TransactionContext |
TransactionContext.ObjectEntry |
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. |
|
TransactionContextImpl(Database db,
boolean globalTx,
javax.transaction.Transaction transaction)
|
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. |
DbMetaInfo |
getConnectionInfo(LockEngine engine)
Returns meta-data related to the RDBMS used. |
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, expireCache, fetch, getClassLoader, getDatabase, getIdentity, getLockTimeout, getObjectEntries, getObjectState, getScope, getStatus, getTransactionTimeout, getXid, isAutoStore, isCached, isDeleted, isDeletedByOID, isDepended, isOpen, isPersistent, isReadOnly, isRecorded, load, load, markCreate, markModified, markUpdate, prepare, query, query, release, removeTxSynchronizable, rollback, setAutoStore, setCallback, setInstanceFactory, setLockTimeout, setStatusActive, 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)
public TransactionContextImpl(Database db, boolean globalTx, javax.transaction.Transaction transaction) throws javax.transaction.SystemException
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 enginepublic DbMetaInfo getConnectionInfo(LockEngine engine) throws PersistenceException
TransactionContext
getConnectionInfo
in class TransactionContext
engine
- LockEngine instance used.
PersistenceException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |