Skip to content

Transactions

Transactions group Data Dictionary operations so related creates, updates, and deletes complete together or roll back together.

Transaction command block

Wrap related Data Dictionary operations in a Begin_Transaction / End_Transaction block:

Begin_Transaction
    Clear oCustomerDD
    Move "Data Access" to oCustomerDD.Name
    SaveRecord oCustomerDD
End_Transaction

See Begin_Transaction and End_Transaction for command syntax.

See the cDbTransactionManager API reference for transaction manager members.

Data Dictionary operations inside transactions

Readers normally group these Data Dictionary operations in a transaction:

  • Request_Save
  • SaveRecord
  • Request_Delete
  • DeleteRecord
  • ZeroFile

See Data Dictionaries for Data Dictionary save, delete, and storage operations.

Nesting and completion

Transactions are nestable. A matching End_Transaction completes each transaction block.

Driver participation

Drivers participating in transaction coordination should keep BeginTransaction, CommitTransaction, and RollbackTransaction consistent with create, update, and delete behavior.

See Building Database Drivers for driver operation and transaction guidance.

Checklist

  1. Start the block before the first related DD operation.
  2. Keep all related DD save/delete operations inside the block.
  3. Match every Begin_Transaction with End_Transaction.
  4. Decide driver transaction behavior before implementing a custom driver.