ISOLATION levels
From: *** (deacdb2_at_hotmail.com)
Date: 06/25/04
- Next message: Mingqing Cheng [MSFT]: "RE: 64bit and performance counters"
- Previous message: H Dirie: "Identifying DTS name in SQL Agent"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 24 Jun 2004 20:58:28 -0700
What do you think about these statements?
It seems to me that isolation levels only affect reads (SELECT statements) in the current transaction because isolation levels only affect how S locks are used.
If the transaction contains only INSERT, UPDATE or DELETE, isolation level doesn't matter since they all use X locks.
So in the transaction below, even READ UNCOMMITTED would work the same as SERIALIZEABLE since there are no SELECT statements. I've done quite a bit of testing to try to break it and I can't. What's wrong with my thinking?
BEGIN TRANSACTION
UPDATE savings SET Balance = Balance - 1000 WHERE SSAN = 555-55-5555;
UPDATE checking SET Balance = Balance + 1000 WHERE SSAN = 555-55-5555;
COMMIT -- or ROLLBACK
I must confess that when it comes to critical data like money I tend to use SERIALIZEABLE anyway, perhaps to avoid lawsuits. ;-)
thanks,
***
- Next message: Mingqing Cheng [MSFT]: "RE: 64bit and performance counters"
- Previous message: H Dirie: "Identifying DTS name in SQL Agent"
- Messages sorted by: [ date ] [ thread ]