开发者

DotNetNuke UserController.GetUser(PortalId,UserId, False) inside TransactionScope throws TransactionAbortedException

Either DotNetNuke UserController.GetUser(PortalId,开发者_开发问答UserId,false) or UserController.ValidateUser(...) inside TransactionScope is causing TransactionAbortedException and the innerException is TransactionPromotionException. The symptoms are the same as this.

Could anyone suggest me the solution to this issue? Thanks a lot !

using (System.Transactions.TransactionScope ts = new System.Transactions.TransactionScope())
    {
        DotNetNuke.Entities.Users.UserInfo ui = DotNetNuke.Entities.Users.UserController.GetUser(PortalId, UserId, false);         
        ts.Complete();
    }


By default DotNetNuke uses the ASP.NET 2.0 membership provider. As you pointed, Membership.GetUser() opens another database connection, which causes the exception inside TransactionScope.

If you want to use GetUser() inside TransactionScope, you'll either have to enable MSDTC or use SQL Server 2008. SQL 2008 allows multiple connections within a single TransactionScope, if the connections are to the same DBMS and are not open at the same time.

See Also:

TransactionScope automatically escalating to MSDTC on some machines?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜