INF: Cursor Behavior in Autocommit ModeLast reviewed: September 9, 1996Article ID: Q94984 |
The information in this article applies to:
SUMMARYThis article discusses the behavior of cursors when autocommit mode is ON. Specifically, it discusses the limitations of using multiple statement handles in this mode.
MORE INFORMATIONODBC drivers that are transaction-capable support two modes for transactions: manual commit and autocommit. In manual commit mode, the driver begins a transaction when an application submits a SQL statement and no transaction is open. It commits or rolls back the transaction on a call to SQLTransact. In autocommit mode, each SQL statement is a single, complete transaction; the driver commits one transaction for each statement. All the statement handles belonging to a connection handle share the same transaction space. Thus, calling SQLTransact commits or rolls back all the inserts, deletes, and updates that are in progress on all statement handles associated with the connection. Every statement handle corresponds to a cursor that is automatically opened when a statement is executed. When a statement is committed or rolled back, the open cursor may exhibit three types of behavior:
The above discussion applies only if the driver is transaction capable (that is, the SQLGetInfo with fInfoType = SQL_TXN_CAPPABLE returns 1). If the driver is not transaction capable (like a 1-tier ISAM driver), then there is no concept of a transaction commit, so hstmt1 can continue fetching.
|
KBCategory: kbusage
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |