Skip to content

Class: cDbTransactionManager

Include: Use Db\cDbTransactionManager.pkg

Hierarchy: cObject -> cDbTransactionManager

Package: Db\cDbTransactionManager.pkg

cDbTransactionManager tracks transaction depth and notifies subscribed drivers on commit or rollback. ghoDbTransactionManager is the global manager handle. Drivers can implement OnCommitTransaction and OnRollbackTransaction callbacks for transaction participation.

Properties

See Properties.

Name Purpose
piTransactionDepth Current nested transaction depth.
piTransactionId Current transaction identifier.
paSubscribers Driver subscribers participating in the transaction.

Methods

See Methods.

Name Purpose
BeginTransaction Begins or nests a transaction and increments the transaction ID at the outermost level.
CommitTransaction Commits the current transaction and notifies subscribers.
RollbackTransaction Rolls back the current transaction and resets subscribers and depth.
Subscribe Subscribes a driver to transaction callbacks.
IsInTransaction Returns true when transaction depth is greater than zero.

Example

Send BeginTransaction of ghoDbTransactionManager
// save related records
Send CommitTransaction of ghoDbTransactionManager

See also