When to call SQLTransact() in a DB2® UDB CLI application
If you want to decide when to end a transaction, consider this information.
- You can only commit or roll back the current transaction, so keep dependent statements within the same transaction.
- Various locks are held while you have an outstanding transaction. Ending the transaction releases the locks, and allows access to the data by other users. This is the case for all SQL statements, including SELECT statements.
- As soon as a transaction has successfully been committed or rolled back, it is fully recoverable from the system logs (this depends on the Database Management System (DBMS)). Open transactions are not recoverable.
Parent topic:
Committing or rolling back in a DB2 UDB CLI application