IBM Books

Call Level Interface Guide and Reference

AUTOCOMMIT and CURSOR WITH HOLD Defaults

Previous versions of DB2 CLI did not support autocommit (each statement is a transaction), and was thus equivalent to having AUTOCOMMIT set to off. DB2 CLI Version 2.1 now supports autocommit, but in order to be consistent with ODBC, the default autocommit behavior is on.

To enable existing DB2 CLI applications to run with the same behavior as previous versions, set the AUTOCOMMIT keyword to 0. This keyword applies to all applications; for this reason new applications should explicitly override the keyword and set the autocommit connection option to the required value.

Support for specifying CURSOR WITH HOLD was also added in Version 2.1, with a default of with hold on. Since this was not supported in previous versions, with hold was effectively set off.

Although this change does not affect the behavior of applications as much as autocommit, the CURSORHOLD keyword should be set to 0 (cursors are not maintained after a commit). This keyword applies to all applications, for this reason new applications should explicitly override the keyword and set the CURSORHOLD statement option to the required value.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]