Read Past and No Lock

  • Hi Everyone,

    We have a third party program that significantly locking the table whenever this edit form will be loaded.

    My problem is I have a customize app that points into that table, recently I am successful using the (read past) to avoid being block sacrificing the recent inserted data.

    Now I have a problem because it is being block, and I don't know why. I manage to use the (no lock) and we are running back to normal now.

    My concern is when time happens that we will be having a blocking issue again using this (no lock). We run out of options.

    With this may I ask for any inputs, I will religiously do the research. Thank you in advance!

    Regards,

    Vincent

  • The quick and dirty is that readpast skips locked records. This causes a problem if the front page is grabbing a table lock, instead of row/page locks. SQL Server will actually decide when and where to do this unless specific hints are given (and it's supposed to).

    NOLOCK is a dirty read. It means you can't trust the data. You are reading locked records, and just don't care what someone else is doing with them. Under 99.99% of conditions... you're okay. That .01% is a killer, though.

    Avoid nolocks on things like: produce 'finalized' financial statements, password checks, or when multi-table integrity is vital. The things that should never be dirty read I hope will stand out.

    However, for this case, your nolock should never fail you for the same reasons. Only data integrity reasons.


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • Hi Craig,

    Thank you for your inputs, I feel relieve.

    Regards,

    Vincent

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

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