|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.castor.persist.AbstractTransactionContext
org.castor.persist.LocalTransactionContext
public final class LocalTransactionContext
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 | |
---|---|
LocalTransactionContext(Database db)
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. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LocalTransactionContext(Database db)
db
- Database instanceMethod Detail |
---|
protected 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()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |