Click here to Skip to main content
15,911,848 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi friends
designing an accounting software using c# winform . so here is a case that requires me to insert into one table and update another table say deduct 10 from accountA and update accountB .i know i have to use transaction but my problem now is choosing the type of isolation i should use,or should i just use the default isolation level
thanks in advance...
Posted

I'd stick with the default. And most people would do that in a stored procedure.
 
Share this answer
 
Comments
Richard Deeming 4-Jul-14 9:35am    
The default isolation level is "Read Committed". That can give you both phantom reads and non-repeatable reads, which wouldn't be acceptable for a transaction moving money between accounts.
For accounting solutions, I'd be inclined to use SERIALIZABLE. All other levels could potentially lead to problems.

Isolation Levels in the Database Engine[^]

SNAPSHOT might seem tempting, but it has numerous problems for this type of application:
The SNAPSHOT Isolation Level[^]

SQL Server 2005 Row Versioning-Based Transaction Isolation : Understanding Isolation[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900