交易范围及使用 [英] Transaction Scope and using
问题描述
如果我使用
使用(Transactionscope范围= 新……)
{
}
如何将事务作用域用于多个对象?
我可以将范围对象转移到对象吗?
格式化了代码,并提高了英语水平. > BulbulAhmed写道:
如何对多个对象使用事务作用域?
在using
块中执行所需的任何操作.
BulbulAhmed写道:我可以将范围对象转移到对象吗?
只要您在交易范围内(即在using
子句中)进行操作即可.尽管您始终可以在没有using
子句的情况下实例化TransactionScope
.
这应该很有用:
http://msdn.microsoft.com/en-us/library/ms172152.aspx [ ^ ]
If I use
using(Transactionscope scope = new......)
{
}
how can I use transaction scope for multiple objects?
Can I transfer scope object to object?
[Edit Keith Barrow] Formatted code and improved English a little while I was at it.
BulbulAhmed wrote:how can I use transaction scope for multiple objects?
Do whatever you need to do inside theusing
block.
BulbulAhmed wrote:Can I transfer scope object to object?
As long as you do it within the scope of the transaction (i.e. in theusing
clause). Though you can always instantiate theTransactionScope
without theusing
clause.
This should be useful:
http://msdn.microsoft.com/en-us/library/ms172152.aspx[^]
这篇关于交易范围及使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!