交易,ASP .NET会员 [英] Transaction for ASP .net Membership
问题描述
我想提出在一个事务中两台数据库操作。这两个操作
I would like to make two database operation in one transaction. Those two operations are
- 请一个插入操作。
- 创建一个用户(使用会员 - SQL成员资格提供)
我试过的TransactionScope ,但去该行分布式事务:
- Membership.CreateUser(测试,密码,test@test.com);
I tried TransactionScope but it went to distributed transaction at that line: -- Membership.CreateUser("test", "password", "test@test.com");
我怎样才能做到这一点与轻量级事务,因为我只有DB?
How can I do this with lightweight transaction since I have only DB?
先谢谢了。
推荐答案
目前实施的TransactionScope,如果你使用一个数据库连接将只使用一个轻量级的事务。所以,不可能在您的方案以实现这一目标。
The current implementation of TransactionScope will only use a lightweight transaction if you use a single database connection. So it is not possible to achieve this in your scenario.
这篇关于交易,ASP .NET会员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!