使用事务亚音速 [英] Using transactions with subsonic
本文介绍了使用事务亚音速的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的web应用程序我已经保持了用户操作的审计。因此,只要用户采取行动更新我在这是采取行动的对象,并保留采取行动的审计线索。
In my web application I've to keep audit of the user actions. So whenever user takes an action I update the object on which action is taken and keep audit trail of that action.
现在如果我第一次修改的对象,然后更新的审计线索,但随后的审计跟踪失败是什么?
Now If I first modify the object and then update audit trail but the audit trail fails then what?
很显然,我需要回滚更改修改的对象。我可以在简单的应用程序使用SQL-交易,但我使用亚音速交谈分贝。我该如何处理这种情况?
Obviously I need to roll-back changes to modified object. I can use Sql-Transactions in simple application, but I'm using Subsonic to talk to db. How I can handle the situation?
推荐答案
是这样的:
Using ts As New System.Transactions.TransactionScope()
Using sharedConnectionScope As New SubSonic.SharedDbConnectionScope()
' Do your individual saves here
' If all OK
ts.Complete()
End Using
End Using
这篇关于使用事务亚音速的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文