|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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.
Constructor Summary | |
---|---|
TransactionContextImpl(Database db,
boolean globalTx)
Create a new transaction context. |
|
TransactionContextImpl(Database db,
boolean globalTx,
javax.transaction.Transaction transaction)
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.sql.Connection |
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 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
db
- Database instanceglobalTx
- Indicates whether we run as part of a global transaction.transaction
- A JTA Transasction instance.
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.sql.Connection 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 |