BUG: Locking While Running Two Transactions on Two Sessions

ID: Q137971

The information in this article applies to:

BUG# NT: 2344 Raid (QJET)

SYMPTOMS

When you run concurrent uncommitted transactions on two different Access databases (.MDB files) on two different connections with AUTOCOMMIT OFF, the second transaction produces an error:

   [Microsoft][ODBC Microsoft Access 2.0 Driver] Couldn't update; currently
   locked by another session on this machine.

The two connections are from the same application.

WORKAROUND

If SQLSetConnectOption AUTOCOMMIT is set to AUTOCOMMIT_ON, there is no locking. Because this problem does not occur with the 32-bit drivers, moving to 32-bit applications is recommended.

STATUS

Microsoft has confirmed this to be a problem in the Access 2.0 ODBC driver version 2.00.2317. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

To reproduce this problem using ODBC Test (16-bit):

1. FullConnect to 1st Access datasource.

2. FullConnect to 2nd Access datasource.

3. Set SQLSetConnectOption to AUTOCOMMITOFF on the 1st connection.

4. Set SQLSetConnectOption to AUTOCOMMITOFF on the 2nd connection.

5. SQLExecDirect on 1st connection (datasource1)

   Select * from tablex(datasource 1) where Field1 = Value1
   and Field2 IN (Value2)

6. GetDataAll (datasource 1)

7. SQLExecDirect on 2nd connection (datasource 2)

   Select * from tabley(datasource 2) where Field1 = Value1
   and Field2 IN (Value2)

   The error occurs here:

     [Microsoft][ODBC Microsoft Access 2.0 Driver] Couldn't update;
     currently locked by another session on this machine.

This problem is not seen the in Access 2.00.2317 32-bit driver or the 3.00.2106 Access driver.

Additional reference words: 2.00.2317 locking transactions connectivity KBCategory: kbprg kbinterop kbbug2.00.2317 KBSubcategory:

Last Reviewed: September 9, 1996