Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 DeadLock Problem

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-11-17 : 07:52:06
Enrico Pannullo writes "I have DeadLock problem with my vb 6.0 code that use ADODB Recordset (Active Data Object 2.5) to update a table in SQL SERVER 2000. This code runs under MTS package.

I open Recordset with these options:
rs.CursorLocation = adUseClient
rs.CursorType = adOpenKeyset
rs.LockType = adLockPessimistic

When two processes simultaneously get recordset and try to update the table i have deadlock.
I'd like to lock the recordset during open operation so How can I do it?

Thank you best regards"

sachinsamuel
Constraint Violating Yak Guru

383 Posts

Posted - 2005-11-17 : 08:23:44

Deadlocks can be reduced by using NOLOCK and ROWLOCK in query.

To avoid deadlocks, please access the database object in the same order.

Using NOLOCK has also got some problems like dirty read. Please check the BOL for more details.

Regards
Sachin








Don't sit back because of failure. It will come back to check if you still available. -- Binu
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-11-17 : 09:15:02
Refer this
http://www.sql-server-performance.com/deadlocks.asp

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -