在sql事务中使用的最佳隔离级别 [英] best isolation level to use in sql transaction
本文介绍了在sql事务中使用的最佳隔离级别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨朋友
使用c#winform设计会计软件。所以这里是一个案例,要求我插入一个表并更新另一个表说从accountA扣除10并更新accountB。我知道我必须使用事务但我现在的问题是选择我应该使用的隔离类型,或者我应该只需使用默认的隔离级别
提前感谢...
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...
推荐答案
我坚持使用默认。大多数人都会在存储过程中这样做。
I'd stick with the default. And most people would do that in a stored procedure.
对于会计解决方案,我倾向于使用SERIALIZABLE
。所有其他级别都可能导致问题。
数据库引擎中的隔离级别 [ ^ ]
SNAPSHOT
看起来很诱人,但是这类应用程序存在很多问题:
SNAPSHOT隔离级别 [ ^ ]
SQL Server 2005基于行版本控制的事务隔离:了解隔离 [ ^ ]
For accounting solutions, I'd be inclined to useSERIALIZABLE
. 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[^]
这篇关于在sql事务中使用的最佳隔离级别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文