COMMIT statement (Terminate transaction normally)
Function
The COMMIT statement terminates the current transaction normally, sets synchronization points, generates one unit of commitment, and puts into effect the database updates performed by the transaction.
Privileges
Format
Operands
This operand has no effect on the normal transaction termination function of the COMMIT statement. The WORK operand is supported for compatibility with JIS standards.
Specifies that the UAP is to be disconnected from HiRDB after the transaction terminates normally.
Common rules
- Executing a COMMIT statement closes all cursors that are open, except for holdable cursors.
- All locked resources, except for those being used by holdable cursors, are released.
- Executing the COMMIT statement nullifies all effective locators.
Notes
- The COMMIT statement cannot be specified from an X/Open-compliant UAP executing under OLTP or from a Java procedure. If a procedure is called from a UAP running under OLTP, procedures using the COMMIT statement cannot be executed.
- When executing the COMMIT statement from a procedure, you cannot specify the RELEASE operand.
- The COMMIT statement cannot be executed during trigger action.
Examples
- Enter a COMMIT statement with the RELEASE operand specified to terminate a transaction, then reconnect to HiRDB:
![[Figure]](figure/zu5s0010.gif)
- Enter a COMMIT statement to terminate a transaction either within a procedure or upon completion of the procedure:
![[Figure]](figure/zu5s0030.gif)