.NET TransactionScope类和T-SQL TRAN COMMIT和ROLLBACK [英] .NET TransactionScope class and T-SQL TRAN COMMIT and ROLLBACK
问题描述
我目前正在编写一个应用程式,需要为我的商家实体进行多次插入,更新和删除。我使用TransactionScope类保证所有存储过程可以作为一个单一的工作单元提交或回滚。
I am current writing an application that will require multiple inserts, updates and deletes for my business entity. I am using the TransactionScope class to guarantee all the stored procedures can commit or roll back as a single unit of work.
我的问题是,我还要使用COMMIT如果我在.NET类库中使用TransactionScope类,那么TRAN和ROLLBACK TRAN是我的每个存储过程?
My question is, I am required to also use COMMIT TRAN and ROLLBACK TRAN is each of my stored procedures if I am using the TransactionScope class in my .NET class library?
推荐答案
ON 2005年它不必要,在2000年我会,我通常把交易范围在一个使用块。
ON 2005 its not necessary, on 2000 I would ,Also, i usually put the transactionscope in a "using" block.
在2000年使用它有一些性能问题,旧版本vs 2005年。
There are some performance issues when using it on 2000 and older vs 2005.
请参阅此处
感谢
这篇关于.NET TransactionScope类和T-SQL TRAN COMMIT和ROLLBACK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!