Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Locking a Record
Message
From
09/09/2014 23:18:55
 
 
To
09/09/2014 23:11:17
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2014
Application:
Web
Miscellaneous
Thread ID:
01607215
Message ID:
01607256
Views:
37
>>If I can make a suggestion - putting that code inside a TRY/CATCH would enable you to write out (and raise) an error back to the calling proc, in case two people try to do the same thing at the same time - the "loser" would at least get a graceful error, if you've got exception handling built in.
>
>Would there be an easy way to just attempt the call again when it's unlocked? I suppose that would happen on the app level, correct?

I've seen that done at the app level - where an immediate failure is raised back to the app, with a message to the user asking if they want to try again, etc. (This is going a bit overboard, but in that situation you could have a call back to the database to read the SQL system tables to see what processes have locked rows for that table, and even who the connection/user is) So in that case you've got a TRY/CATCH both in the proc and in the application.
Previous
Reply
Map
View

Click here to load this message in the networking platform