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 2005 Forums
 Transact-SQL (2005)
 Help

Author  Topic 

sqlfresher2k7
Aged Yak Warrior

623 Posts

Posted - 2009-11-02 : 16:24:12
A deadlock issue was reported.The profiler has captured the deadlock and in all cases there was an update and a select on one table and the select statement was chosen as the deadlock victim.

Front end is Java,Back end :sqlserver 2005

How do i resolve the deadlock..Please suggest.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-11-02 : 16:26:10
You should switch your isolation level to READ_COMMITTED_SNAPSHOT in order to prevent reads from blocking writes.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

sqlfresher2k7
Aged Yak Warrior

623 Posts

Posted - 2009-11-03 : 09:51:20
Thanks Tara Kizer !
I have reviewed all the sql as well java there are no update and select found...but it might be the Hibernate must be generating the quey..Do you still suggest to switch the isolation level to READ_COMMITTED_SNAPSHOT in order to prevent reads from blocking writes...
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2009-11-03 : 11:09:40
in your 1st post you said there was an UPDATE and a SELECT and in your 2nd you say there isn't?

Profiler will capture the queries for you regardless of client
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-11-03 : 12:49:13
You said the deadlock graph shows an update and a select, so therefore you should switch to READ_COMMITTED_SNAPSHOT.

It is the recommended isolation level anyway for OLTP systems, so I recommend it for everyone's systems. The default is READ_COMMITTED.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

sqlfresher2k7
Aged Yak Warrior

623 Posts

Posted - 2009-11-03 : 15:43:29
Thanks I will change the isolation level ..
Go to Top of Page
   

- Advertisement -