Multiple processes accessing the same table. some to write others to read / Lock

  • Dears,

    Hope this message finds you well

    We have a log table which is used at same time by some processed to read and others to write. This is causing deadlock

    What can we do to secure that we end up with deadlocks?

    Shall we shift the isolation level on the read queries or something like that?

    thanks a lot for a guidance

    Best regards,

     

    Pedro

     

     

     

     

  • Simply reading from a table that is being written to should not cause a deadlock. Are you sure that the read queries are causing the deadlocks?

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • can you post a deadlock xml so we can look at it.

    as well as the code involved in writing-reading that log table

  • Are you getting deadlocks, with a deadlock victim, errors and all that? Or, are you seeing excessive blocking and long wait times on queries, which is absolutely not the same thing as a deadlock?

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • river1 wrote:

    Dears,

    Hope this message finds you well

    We have a log table which is used at same time by some processed to read and others to write. This is causing deadlock

    What can we do to secure that we end up with deadlocks?

    Shall we shift the isolation level on the read queries or something like that?

    thanks a lot for a guidance

    Best regards,

    Pedro

    Lots of good replies here for you to follow up on.

    Do you understand the difference between locks\blocks and deadlocks?

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

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

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