TransactionContext
public final class LocalTransactionContext extends AbstractTransactionContext
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.Constructor | Description |
---|---|
LocalTransactionContext(Database db) |
Create a new transaction context.
|
Modifier and Type | Method | Description |
---|---|---|
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.
|
protected java.sql.Connection |
createConnection(LockEngine engine) |
|
protected void |
rollbackConnections() |
The derived class must implement this method and rollback all the
connections used in this transaction.
|
addTxSynchronizable, clearConnections, close, commit, connectionsIterator, create, delete, expireCache, fetch, getClassLoader, getConnection, getConnectionInfo, getDatabase, getInstanceFactory, getLockTimeout, getNamedNativeQuery, getNamedQuery, getStatus, getTransactionTimeout, getWaitOnLock, isAutoStore, isCached, isCreated, isDeleted, isDeletedByOID, isDepended, isLocked, isOpen, isPersistent, isReadOnly, isRecorded, isUpdateCacheNeeded, isUpdatePersistNeeded, iterateReadWriteObjectsInTransaction, load, load, markCreate, markModified, markUpdate, prepare, query, removeTxSynchronizable, rollback, setAutoStore, setCallback, setInstanceFactory, setLockTimeout, setStatus, setTransactionTimeout, setWaitOnLock, trackObject, untrackObject, update, writeLock
public LocalTransactionContext(Database db)
db
- Database instanceprotected java.sql.Connection createConnection(LockEngine engine) throws ConnectionFailedException
createConnection
in class AbstractTransactionContext
ConnectionFailedException
#createConnection(org.exolab.castor.persist.LockEngine)
protected void commitConnections() throws TransactionAbortedException
TransactionAbortedException
,
causing a rollback to occur as the next step.commitConnections
in class AbstractTransactionContext
TransactionAbortedException
- The transaction could not commit fully
or partially and should be rolled back.AbstractTransactionContext.commitConnections()
protected void rollbackConnections()
rollbackConnections
in class AbstractTransactionContext
AbstractTransactionContext.rollbackConnections()
protected void closeConnections() throws TransactionAbortedException
closeConnections
in class AbstractTransactionContext
TransactionAbortedException
- The transaction could not close all the
connections.AbstractTransactionContext.closeConnections()
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com