Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

2.8 Transaction Processing

There are two ways to control transactions through DB-Library:

Each of these techniques is described below.

2.8.1 Setting Isolation Levels

You can use the isolation() method of RWDBConnection to set the isolation level of the SQL server. Table 5 shows the mapping between the IsolationType argument you pass and the isolation level set by the SQL server. Take special care when setting isolation levels as this effects all users of the SQL server.

Table 5 -- Setting the isolation level

 
RWDBConnection::IsolationTypeSybase Isolation Level
Unknown
Level 1 - DIRTY READ
ANSILevel1
Level 1 - DIRTY READ
ANSILevel2
Level 1 - DIRTY READ (Sybase does not support isolation level 2.)
ANSILevel3
Level 3 - REPEATABLE READ

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

2.8.2 Using Transaction Control Methods

You can explicitly control transactions through the following methods:

These methods have straightforward implementations that correspond to the following SQL statements:

An application can add the DBTools.h++ transaction methods to its code to take explicit control of its transaction blocks. Transactions may be nested and the savepoint feature is supported. The savepoint feature allows a current transaction to be partially rolled back to a marked point. The example below demonstrates the use of the savepoint feature and the other transaction processing methods of DBTools.h++.


Previous fileTop of DocumentContentsIndexNext file

©Copyright 1999, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.