.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 TRAN和ROLLBACK TRAN是我的每一个存储过程,如果我使用TransactionScope类在我的.NET类库?
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?
推荐答案
2005年它不是必需的,2000年我会,同时,我通常把TransactionScope的一个用块。
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.
请参阅<一href="http://blogs.msdn.com/jmeier/archive/2006/10/12/use-promotable-transactions-while-working-with-sql-server-2005.aspx"相对=nofollow>这里
感谢
这篇关于.NET TransactionScope类和T-SQL TRAN COMMIT和ROLLBACK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!