Commits the active transaction associated with the current connection.
The Commit function block can throw the CwDBConnectionException exception if a database error occurs.
The Commit function block ends the active transaction by committing any changes made to the database associated with the current connection. Together, the Begin Transaction, Commit, and Roll Back function blocks provide management of transaction boundaries for an explicit transaction. This transaction contains SQL queries, which include the SQL statements INSERT, DELETE, or UPDATE, and a stored procedure that includes one of these SQL statements.
Only use Commit if the connection uses explicit transaction bracketing. If the connection uses implicit transaction bracketing, use of Commit results in a CwDBTransactionException exception. If you do not end an explicit transaction with Commit (or Roll Back) before the connection is released, InterChange Server implicitly ends the transaction based on the success of the collaboration. If the collaboration is successful, ICS commits this database transaction. If the collaboration is not successful, ICS implicitly rolls back the database transaction. Regardless of the success of the collaboration, ICS logs a warning.
Before beginning an explicit transaction, you must create a CwDBConnection object with the Get Database Connection function block. Make sure that this connection uses explicit transaction bracketing.
This function block is based on the CwDBConnection.commit() method. For more information, see commit().