How to set Command Timeout of disconnected recordset when Updating in database? 
Author Message
 How to set Command Timeout of disconnected recordset when Updating in database?

Platform: VB6, MTS, SQL7, ADO 2.1

I have two clients (vb6 exe) that use MTS
component to get recordset with one record
and to work on it:

* client A that works with recordset like these:
      LockType = adLockPessimistic
      CursorLocation = adUseServer
      Mode = adModeShareDenyWrite
      Connection Timeout = 3
      Command Timeout = 3

* client B that works with recordset like these:
      LockType = adLockOptimistic
      CursorLocation = adUseClient
      Mode = adModeShareDenyWrite
      Connection Timeout = 3
      Command Timeout = 3

Here are my ideas and I realy do not know where I am
going wrong.
1. When client A stands on recordset X, client B can read
   same record but can not update record X till client A
   moves out from record X.
2. When client B wants to save changed data to SQL Server
   table he calls MTS component code that has something
   like this in it:

   With myRecordSet
      If .ActiveConnection Is Nothing Then
         Set oConn = CreateObject("ADODB.Connection")
         With oConn
            .Mode = Mode
            .ConnectionString = "Provider=SQLOLE.......
            .ConnectionTimeout = 3
            .CommandTimeout = 3
            .CursorLocation = CursorLocation
            .Open
            End With
         .ActiveConnection = oConn
         End If
      .UpdateBatch

Everything works fine in all cases but in case when client A
stands on the same record which client B wants to update.
In this case, component freezes in UpdateBatch command. I think
that problem is with CommandTimeOut. Recordset does not know
when to give up waiting for write lock (it seems that 3 secons
that I wrote does not work). What I want to is, that UpdateBatch
waits N seconds and then raises exception which I will catch in
my code.
What am I doing wrong and how can I do that?



Sat, 01 Dec 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. How to set Command Timeout of disconnected recordset when Updating in database?

2. Q188858 Setting the Recordset's dynamic Command Timeout Property does not time out

3. ADO Update the Database with the modify done on a disconnected recordset in background mode

4. command timeout via recordset

5. Bound controls not updating ADO with adodc.recordset.update command

6. Command Timeout with a recordset

7. how to set recordset clone to second child level recordset in shape command

8. Any VB example code for setting and detecting the timeout on a ADO Recordset.Open

9. Updating Identity field in disconnected recordset

10. Disconnected ADO Recordset-Updating

11. Why won't disconnected Recordset Update??

12. Updating Disconnected recordsets

 

 
Powered by phpBB® Forum Software