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

2.10 Transaction Processing

The DB Access Module for PostgreSQL implements the model of transaction processing of the DB Interface Module with the SQL statement "SET SESSION CHARACTERSTICS AS TRANSACTION ISOLATION LEVEL" and the PostgreSQL language extensions "BEGIN", "COMMIT", and "ROLLBACK."

There are two ways to control transactions through PostgreSQL:

These methods are described below.

2.10.1 Setting Isolation Levels

PostgreSQL supports two levels of settings for transaction isolations levels, one at the session level via the SQL statement "set session characteristics as transaction isolation level " and the other at the transaction level via the SQL statement "set transaction".

The method isolation()of class RWDBConnection sets the session isolation level. Table 5 shows the mapping between the argument you pass for IsolationType, and the isolation level set by the PostgreSQL Access Module.

Table 5: Setting the isolation level

RWDBConnection:: IsolationType PostgreSQL Isolation Level
Unknown (not supported by PostgreSQL)
ANSILevel1 read committed
ANSILevel2 (not supported by PostgreSQL)
ANSILevel3 serializable

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

2.10.2 Using Transaction Control Methods

You can explicitly control transactions through the following methods:

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.

Example 6: Using transaction control methods

The DB Access Module for PostgreSQL does not currently support savepoint. Attempting to use the savepoint features of the DB Interface Module API generates the error RWDBStatus::notSupported for the connection that attempted to create it.



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.