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

2.10 Transaction Processing

Transactions can be controlled by setting transaction isolation levels and by using transaction control methods. These methods are described in the following two sections.

2.10.1 Setting Isolation Levels

You can use the isolation() method of RWDBConnection to set the isolation level of the connection. Table 5 shows the mapping between the argument you pass for IsolationType, and the isolation level set by the MySQL statement SET SESSION TRANSACTION ISOLATION LEVEL.

Table 5: Setting the isolation level

RWDBConnection:: IsolationType MySQLIsolation Level
Unknown READ_UNCOMMITTED
ANSILevel1 READ_COMMITTED
ANSILevel2 REPEATABLE_READ
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:

These methods have straightforward implementations that correspond to the following MySQL calls:


These transaction calls will have the desired affect only when used with transaction-safe tables such as those created with the InnoDB storage engine.

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 3: Using Transaction Control Methods


DB Access Module for MySQL does not support nested transactions.



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.