Been working on a couple of Connection
classes for C#
data CRUD
ops for a couple of days and have been thinking, normally I use a flag to turn on and off the transactions when creating the class, what happens if I use transactions for every non-query i execute? Any advantages of disadvantages i should be aware of?
问问题
119 次
2 回答
0
Long transaction are locking tables, so It's not preferable to do everything in transaction, especially very long running operations, because it can kill your database.
for more info read this: http://simononsoftware.com/are-long-running-transactions-bad/
于 2013-07-05T11:33:07.463 回答
0
你可以写一本关于交易的大书,它的优点和缺点。但主要思想是:除非您为大公司处理 biiiiiig 数据库,否则只使用事务;)
于 2013-07-05T11:34:11.547 回答