|
-
Aug 3rd, 2005, 11:12 PM
#1
Addicted Member
Re: Opinions - with MS SQL Server - how do you lock?
Sorry..TG u r right. I dont know what I was thinking when I wrote that.
-
Aug 4th, 2005, 01:06 AM
#2
Re: Opinions - with MS SQL Server - how do you lock?
I've edited my sample, what would be the value of Field1 with each scenario I've given? Specially at the same millisecond, will it differentiate them through nanoseconds? And what if they are also executed at the same nanosecond?
-
Aug 4th, 2005, 04:55 AM
#3
Re: Opinions - with MS SQL Server - how do you lock?
 Originally Posted by dee-u
I've edited my sample, what would be the value of Field1 with each scenario I've given? Specially at the same millisecond, will it differentiate them through nanoseconds? And what if they are also executed at the same nanosecond?
With a SQL database there is nothing being executed at the same exact time. Everything is sequentially processed - every request for ACTION is put into the LOG file for processing. If the LOG file has two requests to update the same row in it - one will be first, and one will be second - that is the nature of the sequential processing of the LOG file.
If the LOG file indicates that the row the second UPDATE is attempting to touch is locked, the the second ACTION request in the LOG file will hold until the first request processes OR is will deadlock and timeout.
There is no such thing as two requests occuring at the same time. Remember that a single program called SQLSERVER.EXE is taking each ADO request for ACTION on the DATABASE and processing them sequentially.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|