/ SQL Error 1222

SQL Error 1222

SQL   Lock request Error  1222
Time period exceeded

Today we got request from user , user are not able to access the database . They asked us to check the database health , when I  trying to open database , I got error msg Error 1222 .

I opened new query window and executed the following query to find out the active transaction on this database  .
DBCC opentran()

I could see there is one open active transaction is running  on same database and we can see the SPID ids details .   we get the detail about the SPID using following commands

sp_who2 <SPID>
sp_lock <SPID>

For example, if SPID is 188 then execute the command as
sp_who2 188
sp_lock  188

I have informed user SPID 188 has the culprit of LOCK TIME OUT request  and provided the details of SPID to user . I got confirmation user to killing the process ID  188 .

I have executed blow command to kill the process  188 .

KILL 188.

This issue has been resloved ,Now the database is accessible  for all users .


=========================================
MSDN

Product NameSQL Server
Event ID1222
Event SourceMSSQLSERVER
ComponentSQLEngine
Symbolic NameLK_TIMEOUT
Message TextLock request time out period exceeded.

Explanation

Another transaction held a lock on a required resource longer than this query could wait for it.

User Action

Perform the following tasks to alleviate the problem:
  1. Locate the transaction that is holding the lock on the required resource, if possible. Use sys.dm_os_waiting_tasks and sys.dm_tran_locks dynamic management views.
  2. If the transaction is still holding the lock, terminate that transaction if appropriate.
  3. Execute the query again.
If this error occurs frequently change the lock time-out period or modify the offending transactions so that they hold the lock for less time.