Try OpenEdge Now
skip to main content
SQL Reference
SQL Reference : OpenEdge SQL Statements : COMMIT
 

COMMIT

Commits a transaction explicitly after executing one or more SQL statements. Committing a transaction makes permanent any changes made by the SQL statements.

Syntax

COMMIT [ WORK ] ;

Rules to use the COMMIT statement

The following rules should be followed while using the COMMIT statement:
*It can be used in an embedded SQL application.
*It can be used in tools like SQL Explorer which expose the COMMIT operation as a SQL statement.
*It cannot be used in an ODBC or JDBC application because ODBC exposes the COMMIT operation as the ODBC API SQLEndTran() and JDBC exposes the COMMIT operation in the connection object as the commit() method.
*It cannot be used in an OE SQL stored procedure because a stored procedure runs on the OpenEdge SQL server while transactions can be controlled only from a SQLclient.

Notes

*The SQL statements executed prior to executing the COMMIT statement are executed as one atomic transaction that is recoverable and durable. The transaction is serializable if you specify this isolation level.
*On a system failure and/or the execution of the ROLLBACK, the transaction is rolled back to its initial state. Any changes made by the transaction are undone, restoring the database to its initial state. In the event of a system failure, the transaction will be rolled back during crash recovery when the database is restarted.
*A COMMIT operation makes any database modifications made by that transaction permanent.
*Once a COMMIT operation is executed, the database modifications cannot be rolled back.
*Once a COMMIT operation is executed, the transaction modifications are guaranteed durable regardless of any transient system failures.
*The atomicity applies only to the database modification and not to any direct I/O performed to devices such as the terminal, printer, and OS files by the application code.
*A COMMIT operation releases all locks implicitly or explicitly acquired by the transaction.
* Related Statement