org.modelsphere.jack.baseDb.db
Class DbTransaction
java.lang.Object
org.modelsphere.jack.baseDb.db.DbTransaction
public class DbTransaction
- extends java.lang.Object
Implements the transaction concept for the Db framework. A transaction starts with a
beginReadTrans()
or a beginWriteTrans()
. A transactions terminates with
a commitTrans()
(successful completion) or with a a abortTrans()
(unsuccessful completion). All the accesses to DbObject's values (either read accesses or writer
accesses) must occur within a transaction, otherwise a DbException is thrown.
A transaction is ACID (Atomic, Concurrent, Isolated and Durable). Atomic means the transaction is
either totally committed or totally rolled back. Concurrent means multi-user access is handled by
the transaction framework. Isolated means all the changes to the DbObject are not visible to
other users until the transaction is committed. Durable means the transaction are stored in a
transaction history, and can be undone or redone.
A transaction contains an ordered collection of all the commands performed. When the transaction
starts, the command list is empty. An invocation to a setter actually creates a command and add
it to the command list. At the commit time, all the commands are executed. If an error occurs
when executing a command, and the previously executed commands are rolled back, in order to leave
the DbObject instance in the same state it was when the transaction begun.
Transactions are managed by the Db instance. Transaction commands can be executed in reverse
order (undo operation).
- See Also:
Db.beginReadTrans()
,
Db.beginWriteTrans(String)
,
Db.commitTrans()
,
Db.abortTrans()
,
Db.undo()
,
Db.redo()
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
getName
public final java.lang.String getName()
- Returns:
- The localized transaction name.
setName
public final void setName(java.lang.String name)
- Parameters:
name
- The new localized name. This value is visible to the user.
getDescription
public final java.lang.String getDescription()
setDescription
public final void setDescription(java.lang.String description)
Open ModelSphere 2007. All Rights Reserved.