November 6, 2009 at 11:10 pm
Is there a way to force one or more SQL statements to execute together, even if other connections are trying to process transactions simultaneously? Basically I'm looking for a guarantee similar to sychronized methods in Java, but at the database level.
Thanks,
Kevin
November 7, 2009 at 2:57 am
Hi
I'm not sure if I got you. What about "BEGIN TRANSACTION" "COMMIT TRANSACTION"?
Greets
Flo
November 7, 2009 at 3:08 am
Kevin,
To answer your question literally, the closest analogue to a synchronized method call would be a transaction (as Florian described) running at the SERIALIZABLE isolation level.
I think it is really important that you share your reasons for investigating this, so we can be sure of giving you appropriate advice. Developers often want to directly translate programming concepts to SQL Server (with good reason!) but there are almost always reasons not to do that, and built-in SQL Server features which make it unnecessary anyway.
For example, SQL Server provides a number of methods to implement queuing, and even more to ensure that separate transactions (threads?) do not encounter synchonization-type problems.
So, please share some more detail...thanks!
Paul
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply