locked
Does anyone know what "STATE 24" means for Error: 1222, Severity: 16? RRS feed

  • Question

  • I am getting Error: 1222, Severity: 16, State: 24 in my sql error log. It happened in the early morning hours and I do not have any idea what might have caused it.

    Can someone tell me what STATE 24 means?

    Is there a way to initiate a "trace flag" to run in the background capture the lock without placing to much overhead on the server?

    Thank you,


    Sue

    Thursday, March 26, 2015 6:43 PM

Answers

  • I'm not sure why you would want to know the state number. It is a lock timeout, which is a decently exact error. Apparently you have code that runs with a lock timeout. (Default is to wait forever on locks.)

    State numbers are generally not publically documented, so you would need access to the source code to determine in which situation state 24 is used for a lock timeout.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
    • Proposed as answer by Michelle Li Friday, March 27, 2015 6:56 AM
    • Marked as answer by Michelle Li Wednesday, April 8, 2015 6:38 AM
    Thursday, March 26, 2015 10:53 PM

All replies

  • Hello,

    The lock request time out is probably set on the application side. Probably the application is using the SET LOCK_TIMEOUT command.


    Try to use SQL Server Profiler to see how this command is used from the application side.

    https://msdn.microsoft.com/en-us/library/ms189470.aspx


    About what means state 24, please read the following article.

    https://msdn.microsoft.com/en-us/library/ms164086.aspx


    Hope this helps.



    Regards,

    Alberto Morillo
    SQLCoffee.com




    Thursday, March 26, 2015 7:24 PM
  • Alberto

    Thanks for the reply. The error happened in the middle of the night and the error does not occur consistently. I am sure I can start a trace with profiler but I am concerned about the overhead it creates. Also, I believe I can add some trace flags to the server that will help me determine if the lock occurs again and more information about it.

    I am looking for the "STATE" so I can determine what the error was not the "severity" level.


    Sue

    Thursday, March 26, 2015 8:28 PM
  • I'm not sure why you would want to know the state number. It is a lock timeout, which is a decently exact error. Apparently you have code that runs with a lock timeout. (Default is to wait forever on locks.)

    State numbers are generally not publically documented, so you would need access to the source code to determine in which situation state 24 is used for a lock timeout.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
    • Proposed as answer by Michelle Li Friday, March 27, 2015 6:56 AM
    • Marked as answer by Michelle Li Wednesday, April 8, 2015 6:38 AM
    Thursday, March 26, 2015 10:53 PM