Roll Back

Rolls back the active transaction associated with the current connection.

Inputs

Database connection
A CwDBConnection object that represents the database connection.

Exceptions

The Roll Back function block can throw the CwDBTransactionException exception.

Notes

The Roll Back function block ends the active transaction by rolling back any changes made to the database associated with the current connection. The Begin Transaction, Commit, and Roll Back function blocks together 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. If the roll back fails, Roll Back throws the CwDBTransactionException exception and logs an error.

Important

Only use Roll Back if the connection uses explicit transaction bracketing. If the connection uses implicit transaction bracketing, use of Roll Back results in a CwDBTransactionException exception. If you do not end an explicit transaction with Roll Back (or the Commit function block) before the connection is released, InterChange Server Express implicitly ends the transaction based on the success of the collaboration. If the collaboration is successful, InterChange Server Express commits this database transaction. If the collaboration is not successful, InterChange Server Express implicitly rolls back the database transaction. Regardless of the success of the collaboration, InterChange Server Express logs a warning.

Related information

This function block is based on the CwDBConnection.rollBack() method. For more information, see rollBack().

Copyright IBM Corp. 1997, 2004