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)
 Huge Problem with Deadlock :-(

Author  Topic 

roalme
Starting Member

1 Post

Posted - 2007-11-28 : 08:05:09
Dear All,
I'm working with SQL Server 2000 and for now I am experiencing deadlock problems with the database. We are observing that the Deadlocks occur during the Insert operation in the database.
Is about 50% of the insert operations that have as consequence deadlocks. We have tried to use different type of ISOLATION LEVEL on transactions, but unfortunately we have no progress.
Anyone have any suggestion to help to solve this problem?
Thanks in advance,

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2007-11-28 : 08:32:12
Have you been able to identify what specific operations are involved in the deadlock? That is a good place to start.
If you haven't done so already, read up on what causes deadlocks in BooksOnline so that you know what conditions to look for in your code.

General advice:
* keep your transactions as fast and small as possible.
* if you wrap muliple operations in a single transaction then make sure other code performs those operations in the same order.
classic deadlock case for concurrent operations:
spid 1: insert a then insert b
spid 2: insert b then insert a
* to make sure operations are as fast as possible, make sure you have appropriate optimizations in place including indexes.

Be One with the Optimizer
TG

EDIT:
also, search this site for "deadlock". A lot of topics have discussed it including:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49689
Go to Top of Page

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2007-11-28 : 08:41:33
do you know which two spids are deadlocked? to find out there are a couple of traceflags you can turn on, extra information is written to the sql logs when they are enabled. see BOL for details.

EDIT: looks like these flags are discussed in the post TG linked to above. *blush*


elsasoft.org
Go to Top of Page

Jeff Moden
Aged Yak Warrior

652 Posts

Posted - 2007-12-01 : 21:06:23
Are you, by any chance, using a "sequence table" to determine new IDs for the inserts?

--Jeff Moden
Go to Top of Page
   

- Advertisement -