E
epigram
I'm trying to decide on a concurrency strategy with my asp.net application.
I've seen examples where a dataset is used and the update query's WHERE
clause basically checks to see if the original data (from the original read)
equals the data in the database. I've also seen mention of using a date
stamp which I assume would be used via the same technique. Then the
operation is wrapped inside a transaction.
My question is even though these checks are being made in the dataset's
update query WHERE clause, what would prevent a piece of data from being
updated (by another thread/client) between the time the check is done by the
WHERE clause and the transaction is complete? The transaction doesn't
guarantee the update to be atomic does it? It just seems to me you'd have
to lock a row to use this type of technique. Any pointers to good articles
on this would be much appreciated.
Thanks!
I've seen examples where a dataset is used and the update query's WHERE
clause basically checks to see if the original data (from the original read)
equals the data in the database. I've also seen mention of using a date
stamp which I assume would be used via the same technique. Then the
operation is wrapped inside a transaction.
My question is even though these checks are being made in the dataset's
update query WHERE clause, what would prevent a piece of data from being
updated (by another thread/client) between the time the check is done by the
WHERE clause and the transaction is complete? The transaction doesn't
guarantee the update to be atomic does it? It just seems to me you'd have
to lock a row to use this type of technique. Any pointers to good articles
on this would be much appreciated.
Thanks!