Notification of rowlock to a user in case of concurrent updates

  • When concurrent updates happen to a row of a table in SQL Server 2000, one user should be notified that row is already locked by some other user. Can this be done? How?

  • Why do you want to do this, and what should the user be told? ...and if told, what should the user then do?

    Being put on hold due to locking, isn't any error per definition. The server will just wait until resources are freed, and then continue. This is normal behaviour, and is expected.

    If, on the other hand, you're asking: 'How can I notify a user that is about to commit an update, that the underlying data has changed since the user looked last, and perhaps would like to do a reevaluation'...?

    This is what's called 'optimistic concurrency handling', and can be handled with the timestamp datatype, which in short is a mechanism to version-stamp table rows.

    If this is what you're after, have a look in BOL on 'timestamp'

    /Kenneth

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

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