Committing or rolling back in a DB2 UDB CLI application
The last step for the transaction processing task is to either commit or roll back the transaction using SQLTransact().
A transaction is a recoverable unit of work, or a group of SQL statements that can be treated as one atomic operation. This means that all the operations within the group are to be completed (committed) or undone (rolled back), as if they were a single operation.
When using DB2® UDB call level interface (CLI), transactions are started implicitly with the first access to the database using SQLPrepare(), SQLExecDirect(), or SQLGetTypeInfo(). The transaction ends when you use SQLTransact() to either roll back or commit the transaction. This means that any SQL statements processed between these are treated as one unit of work.
- When to call SQLTransact() in a DB2 UDB CLI application
If you want to decide when to end a transaction, consider this information.
- Effects of calling SQLTransact() in a DB2 UDB CLI application
Here are some effects of calling SQLTransact() in a DB2 UDB call level interface (CLI) application.
Parent topic:
Transaction processing task in a DB2 UDB CLI application