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 DB Access Module for ODBC, using the
SQLSetConnectAttr() call:
Table 5 – Setting the isolation level
RWDBConnection:: IsolationType | ODBC Isolation Level |
---|
Unknown | SQL_TXN_READ_UNCOMMITTED |
ANSILevel1 | SQL_TXN_READ_COMMITTED |
ANSILevel2 | SQL_TXN_REPEATABLE_READ |
ANSILevel3 | SQL_TXN_SERIALIZABLE |
Note that not all ODBC drivers support the notion of isolation levels, and those that support isolation levels do not necessarily support all isolation levels. Special care should be taken when setting isolation levels, as this could affect all users of a server.
To determine the current isolation level, call RWDBConnection::isolation() without an argument.