org.castor.persist

Class LocalTransactionContext

Implemented Interfaces:
TransactionContext

public final class LocalTransactionContext
extends AbstractTransactionContext

A transaction context is required in order to perform operations against the database. The transaction context is mapped to javax.transaction.Transaction for the ODMG API and into javax.transaction.xa.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.
Version:
$Revision: 7085 $ $Date: 2006-04-13 10:49:49 -0600 (Thu, 13 Apr 2006) $
Author:
Ralf Joachim
Since:
1.0

Constructor Summary

LocalTransactionContext(Database db)
Create a new transaction context.

Method Summary

protected void
closeConnections()
protected void
commitConnections()
protected Connection
createConnection(LockEngine engine)
protected void
rollbackConnections()

Methods inherited from class org.castor.persist.AbstractTransactionContext

addTxSynchronizable, clearConnections, close, closeConnections, commit, commitConnections, connectionsIterator, create, createConnection, delete, expireCache, fetch, getClassLoader, getConnection, getConnectionInfo, getDatabase, getLockTimeout, 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, rollbackConnections, setAutoStore, setCallback, setInstanceFactory, setLockTimeout, setStatus, setTransactionTimeout, setWaitOnLock, update, writeLock

Constructor Details

LocalTransactionContext

public LocalTransactionContext(Database db)
Create a new transaction context.
Parameters:
db - Database instance

Method Details

closeConnections

protected void closeConnections()
            throws TransactionAbortedException
Overrides:
closeConnections in interface AbstractTransactionContext

commitConnections

protected void commitConnections()
            throws TransactionAbortedException
Overrides:
commitConnections in interface AbstractTransactionContext

createConnection

protected Connection createConnection(LockEngine engine)
            throws PersistenceException
Overrides:
createConnection in interface AbstractTransactionContext

rollbackConnections

protected void rollbackConnections()
Overrides:
rollbackConnections in interface AbstractTransactionContext

Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com