Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

2.10 Transaction Processing

There are two ways to control transactions through Sybase Client-Library:

Each of these techniques is described below.

2.10.1 Setting Isolation Levels

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

The current isolation level can be determined by calling the function RWDBConnection::isolation() without an argument.

2.10.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 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.