Lock Timeout Alert

  • I have setup an Event Alert for Error Number 1222 "Lock request time out period exceed" and to send an email when that alert occurs. I tested this in Query Analyzer by executing this in one window

    BEGIN TRAN

    UPDATE TableA SET ColA = 1 WHERE ID = 1

    In the second query analyzer window

    SET LOCK_TIMEOUT 1800

    GO

    UPDATE TableA SET ColA = 2 WHERE ID = 1

    I got error

    Server: Msg 1222, Level 16, State 50, Line 1

    Lock request time out period exceeded.

    The statement has been terminated.

    and the alert count increased by 1 and I got an email from sql.

    To test this with my .Net application, I got this error

    "Timeout expired. The timeout period elapsed piror to completion of the operation or the server is not responding."

    I did not get any email from sql and the alert counter did not increase. What gives ?

    TIA

  • You have 2 different errors:

    1 is for your Lock Timeout (first with the QA)

    2 is for you query timeout (time allowed for a query to finish) which seems in your case might be smaller than the LockTimeout (for .NET)


    Kindest Regards,

    Vasc

  • The query timeout is set to 30 seconds in the app. How can I set the LockTimeout in my .Net application ?

  •  

    BOL

    Use the query wait option to specify the time in seconds (from 0 through 2147483647) that a query waits for resources before timing out. If the default value of -1 is used, or if –1 is specified, then the time-out is calculated as 25 times of the estimated query cost.

     

    Your app waits 30 sec till TimeOut?


    Kindest Regards,

    Vasc

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply