Solved

Lock_timeout = -1

Posted on 2010-11-11
2
360 Views
Last Modified: 2012-05-10
Current our sql2005 setting has lock time out = -1,, If I increase this values to maybe 2400 will it reduce db deadlock occurrence ?
0
Comment
Question by:motioneye
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 250 total points
ID: 34117864
SET LOCK_TIMEOUT allows an application to set the maximum time that a statement waits on a blocked resource. When a statement has waited longer than the LOCK_TIMEOUT setting, the blocked statement is automatically canceled, and an error message is returned to the application.

At the beginning of a connection, @@LOCK_TIMEOUT returns a value of -1.

Examples
This example shows the result set when a LOCK_TIMEOUT value is not set.

SELECT @@LOCK_TIMEOUT
Here is the result set:

----------------
-1
This example sets LOCK_TIMEOUT to 1800 milliseconds, and then calls @@LOCK_TIMEOUT.

SET LOCK_TIMEOUT 1800
0
 
LVL 6

Assisted Solution

by:subhashpunia
subhashpunia earned 250 total points
ID: 34119296
It could resuce the deadlock but not solve your altimate problem because it would cancel more transaction than deadlock.
Better way is to identify the processes that commonly deadlocked. Lock duration is not directly proportional to deadlock (even longer lock duration it increases the probability). So setting the @@LOCK_TIMEOUT does not gaurantee to resolve the deadlock.
To know more about the deadlock error and its fix please check this post:

http://blog.sqlauthority.com/2007/05/16/sql-server-fix-error-1205-transaction-process-id-was-deadlocked-on-resources-with-another-process-and-has-been-chosen-as-the-deadlock-victim-rerun-the-transaction/
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question