Support for Isolation Levels Using the OLE DB Provider for DB2
Microsoft Host Integration Server 2004
Support for Isolation Levels Using the OLE DB Provider for DB2

The OLE DB Provider for DB2 provides flexibility in dealing with issues of isolation levels and transaction state. The isolation level for a session can be set using the DBPROP_SESS_AUTOCOMMITISOLEVELS property on a session.

The OLE DB Provider for DB2 supports the following values for the DBPROP_SESS_AUTOCOMMITISOLEVELS and DBPROP_SUPPORTEDTXNISOLEVELS property.

OLE DB property valueDescription
DBPROPVAL_TI_BROWSEThis isolation level is the same as DBPROPVAL_TI_READUNCOMMITTED.

Note that the OLE DB specification and the OLEDB.H include file defines two macros with the same value.

DBPROPVAL_TI_CHAOSAn undefined value for isolation level.

This value is not supported using the OLE DB Provider for DB2.

DBPROPVAL_TI_CURSORSTABILITYThis isolation level is the same as DBPROPVAL_TI_READCOMMITTED.

Note that the OLE DB specification and the OLEDB.H include file defines two macros with the same value.

DBPROPVAL_TI_ISOLATEDThis isolation level is the same as DBPROPVAL_TI_SERIALIZABLE.

Note that the OLE DB specification and the OLEDB.H include file defines two macros with the same value.

DBPROPVAL_TI_READCOMMITTEDWhen this property is set, it isolates any data read from changes by others and changes made by others cannot be seen. The re-execution of the Read statement is affected by others. This does not support a repeatable read.

This is the default value for isolation level.

This isolation level is also called Cursor Stability (CS) in IBM DB2 documentation.

This isolation level corresponds with the ADO property set to adXactReadCommitted.

DBPROPVAL_TI_READUNCOMMITTEDWhen this property is set, it does not isolate data read from changes by others and changes made by others can be seen. The re-execution of the Read statement is affected by others. This does not support a repeatable read.

This isolation level is called Uncommitted Read (UR) in IBM DB2 documentation.

This isolation level corresponds with the ADO property set to adXactReadUncommitted.

DBPROPVAL_TI_REPEATABLEREADWhen this property is set, it isolates any data read from changes by others and changes made by others cannot be seen. The re-execution of the read statement is affected by others. This supports a repeatable read.

This isolation level is called Read Stability (RS) in IBM DB2 documentation.

This isolation level corresponds with the ADO property set to adXactRepeatableRead.

DBPROPVAL_TI_SERIALIZABLEWhen this property is set, it isolates any data read from changes by others and changes made by others cannot be seen. The re-execution of the read statement is not affected by others. This supports a repeatable read.

This isolation level is called Repeatable Read (RR) in IBM DB2 documentation.

This isolation level corresponds with the ADO property set to adXactSerializable.

The isolation level can also be set by calling ITransactionLocal::StartTransaction with the appropriate value for the IsoLevel parameter to start a new transaction. Note that the same integer values used for the DBPROP_SESS_AUTOCOMMITISOLEVELS and DBPROP_SUPPORTEDTXNISOLEVELS property values are also used for the IsoLevel parameter passed to the ITransactionLocal::StartTransaction method. The legal values for the IsoLevel parameter are defined in Transact.h while the OLE DB property values for isolation level are defined in OLEDB.h. While the #define macro strings used for the OLE DB property values and the IsoLevel parameter values differ, the integer values of these macros are the same.

The following table shows the OLE DB property values for isolation level and the equivalent IsoLevel parameter passed to ITransactionLocal::StartTransaction.

OLE DB isolation level propertyOLE DB IsoLevel parameter
DBPROPVAL_TI_BROWSEISOLATIONLEVEL_BROWSE
DBPROPVAL_TI_CURSORSTABILITYISOLATIONLEVEL_CURSORSTABILITY
DBPROPVAL_TI_ISOLATEDISOLATIONLEVEL_ISOLATED
DBPROPVAL_TI_READCOMMITTEDISOLATIONLEVEL_READCOMMITTED
DBPROPVAL_TI_READUNCOMMITTEDISOLATIONLEVEL_READUNCOMMITTED
DBPROPVAL_TI_REPEATABLEREADISOLATIONLEVEL_REPEATABLEREAD
DBPROPVAL_TI_SERIALIZABLEISOLATIONLEVEL_SERIALIZABLE

Nested transactions are not supported by the OLE DB Provider for DB2. If there is already an active transaction on the session (that is, StartTransaction has been called with no matching ITransaction::Commit or ITransaction::Abort), it is not possible to start a new transaction below the current transaction. Calling ITransactionLocal::StartTransaction when there is already an active transaction on the session returns XACT_E_XTIONEXISTS.

IBM documents isolation level in DB2 documentation using somewhat different terms. The following table shows how the OLE DB values for isolation level are mapped to the terms used by IBM DB2 for isolation level.

OLE DB isolation levelIBM DB2 isolation level
DBPROPVAL_TI_BROWSEUncommitted Read (UR)
DBPROPVAL_TI_CURSORSTABILITYCursor Stability (CS)
DBPROPVAL_TI_ISOLATEDRepeatable Read (RR)
DBPROPVAL_TI_READCOMMITTEDCursor Stability (CS)
DBPROPVAL_TI_READUNCOMMITTEDUncommitted Read (UR)
DBPROPVAL_TI_REPEATABLEREADRead Stability (RS)
DBPROPVAL_TI_SERIALIZABLERepeatable Read (RR)

To download updated Host Integration Server 2004 Help from www.microsoft.com, go to http://go.microsoft.com/fwlink/?linkid=29507.

Copyright © 2004 Microsoft Corporation.
All rights reserved.
© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View