Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
DB Access Module for DB2 CLI User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

2.11 Transaction Processing

There are two ways to control transactions through the DB Access Module for DB2 CLI:

Each of these techniques is described below.

2.11.1 Setting Isolation Levels

You can use the isolation() method of RWDBConnection to set the isolation level of your connection. Table 4 shows the mapping between the IsolationType argument you pass, and the isolation level set by the SQLSetConnectAttr() call.

Table 4: Setting the isolation level

RWDBConnection:: IsolationType ODBC Isolation Level IBM Isolation Level
Unknown SQL_TXN_READ_UNCOMMITTED Uncommitted Read
ANSILevel1 SQL_TXN_READ_COMMITTED Cursor Stability
ANSILevel2 SQL_TXN_REPEATABLE_READ Read Stability
ANSILevel3 SQL_TXN_SERIALIZABLE Repeatable Read

To determine the current isolation level, call RWDBConnection::isolation() without an argument.

2.11.2 Using Transaction Control Methods

You can explicitly control transactions through the following methods of the DB Interface Module:

These methods have straightforward implementations that correspond to the following DB2 functions:

An application can add the DB Interface Module transaction methods to its code to take explicit control of its transaction blocks. The following code demonstrates how these methods can be used to commit or to rollback transactions:

Please note that nested transactions and savepoint features are not supported by DB2.


DB2 does not support nested transactions and savepoint features.

Attempting to create a nested transaction generates a server error. Attempting to use the savepoint features of the DB Interface Module generates the error RWDBStatus::notSupported for the connection that tried.



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and SourcePro, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.