Jump to content

Lesson Learned #319: Lock request time out period exceeded using SSMS


Recommended Posts

Guest Jose_Manuel_Jurado
Posted

Today, we got a service request that our customer got the following error message: Lock request time out period exceeded. (.Net SqlClient Data Provider) using SQL Server Management Studio. Following I would like to share with you some details about this issue and how to find and fix it.

 

 

 

The first thing is to run a transaction without adding commit transaction, for example:

 

 

 

 

 

 

 

begin transaction

CREATE TABLE IX7 (ID INT)

 

 

 

 

 

 

 

Second, modify the SET LOCK TIMEOUT in SQL Server Management Studio->Tools->Options->Query Execution->SQL Server->Advanced change the SET LOCK TIMEOUT from -1 to 10000 miliseconds.

 

 

 

518x272vv2.png.bba2df80b5b6f467e9e7bfaf746e9951.png

 

 

 

Third, go to the Object Explorer and try to expand tables and after around 10 seconds you are going to have the error message:

 

 

 

519x118vv2.png.41448272daf155c145e894cb2a70c8dd.png

 

 

Why is happening this error?

 

 

 

 

First, let's investigate what is doing SQL Server Management Studio to fill up the list of the tables, using SQL Server Profiler of Azure Data Studio.

 

 

 

516x263vv2.png.e40547a491cdb8e423c0870c764eebde.png

 

 

 

  • Following the instrucctions, SSMS specified SET LOCK TIMEOUT 10000 and after it try to execute the query: SELECT SCHEMA_NAME(tbl.schema_id) AS [schema], tbl.name AS [Name], tbl.object_id AS [iD] FROM sys.tables AS tbl ORDER BY [schema] ASC,[Name] ASC
  • As sys.tables is now blocking by a previous CREATE TABLE instrucction we have to wait to release this blocking. Following our article here: Lesson Learned #22: How to identify blocking issues? - Microsoft Community Hub you could find the blocking issue:

 

768x60vv2.png.8dbfa8c7770c870ba0136fbcd89ca9bc.png

 

  • Finally, after this 10 seconds we are going to receive this error message meanwhile we don't execute the commit transaction of the execution of CREATE TABLE.

 

 

 

Sometimes, this issue could happen to performance issues.

 

 

 

Enjoy!

 

Continue reading...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...