"此SqlTransaction已完成;它不再可用."...配置错误? [英] "This SqlTransaction has completed; it is no longer usable."... configuration error?

查看:743
本文介绍了"此SqlTransaction已完成;它不再可用."...配置错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经从事了大约一天半的时间,并在网络上搜索了许多博客和帮助文章.我在SO上发现了几个与此错误有关的问题,但我认为它们并没有完全适用于我的情况(或者,在某些情况下,不幸的是,我对它们的理解不够深刻,无法实现:P).我不确定我能否描述得足够好以寻求帮助...但是这里有:

I've been working on this for about a day and a half now, and searched numberous blogs and help articles on the Web. I found several questions on SO related to this error, but I didn't think they quite applied to my situation (or in some cases, unfortunately, I couldn't understand them well enough to implement :P). I'm not sure I can describe this well enough for help... but here goes:

我们有一个.NET应用程序来跟踪我们的资源.有一个导出功能,可以将资源复制到时间跟踪系统和计费系统中;这将访问一个存储过程,该存储过程链接到时间数据库和计费数据库.

We have a .NET app to track our resources. There's an export function to copy a resource to the time tracking system and the billing system; this accesses a stored procedure that links to the time and billing databases.

我最近将计费系统数据库移到了新服务器(原始服务器:Server 2003 SP2,SQL 2005;新服务器:Server 2008 R2,SQL 2008 R2).我有一个指向2008数据库的链接服务器设置.我将存储过程更新为指向2008服务器,然后收到有关MSDTC和RPC的错误(http://www.safnet.com/writing/tech/archives/2007/06/server_myserver.html).我在链接服务器上启用了"rpc/rpc out",并将MSDTC设置为允许网络访问(如下所示: http://www.sqlwebpedia.com/content/msdtc-troubleshooting ).

I recently moved the billing system database to a new server (original server: Server 2003 SP2, SQL 2005; new server: Server 2008 R2, SQL 2008 R2). I have a Linked Server set up that points to the 2008 databases. I updated the stored procedure to point to the 2008 server, and then I got an error about MSDTC and RPC (http://www.safnet.com/writing/tech/archives/2007/06/server_myserver.html). I enabled 'rpc/rpc out' on the Linked Server and set MSDTC to allow Network Access (something like this: http://www.sqlwebpedia.com/content/msdtc-troubleshooting).

现在,当我尝试运行导出功能时,我得到了上面的内容:此SqlTransaction已完成;它不再可用."在我看来,奇怪的是,当我刚刚运行存储过程(来自SSMS)时,它说成功完成了.

Now I'm getting the above, when I try to run the export function: "This SqlTransaction has completed; it is no longer usable." What seems odd to me is that when I just run the stored procedure (from SSMS), it says it completes successfully.

以前有人看过吗?我是否错过了配置中的某些内容?我不断浏览相同的页面,唯一发现的是更改了MSDTC之后,我没有重新启动(在此处提到:

Has anyone seen this before? Have I missed something in the configuration? I keep going over the same pages, and the only thing I found was that I didn't reboot after making the MSDTC changes (mentioned in here: http://social.msdn.microsoft.com/forums/en-US/adodotnetdataproviders/thread/7172223f-acbe-4472-8cdf-feec80fd2e64/).

我可以发布部分或全部存储过程,如果有帮助的话……请告诉我.

I can post part or all of the stored procedure, if it would help... please let me know.

推荐答案

我认为此错误消息是由于僵尸交易"引起的.

I believe this error message is due to a "zombie transaction".

查找事务处理两次提交(或回滚两次,或回滚并提交等)的可能区域. SP已提交事务后,.Net代码是否提交事务? .Net代码是否会在遇到错误时将其回滚,然后尝试在catch(或最后)子句中再次将其回滚?

Look for possible areas where the transacton is being committed twice (or rolled back twice, or rolled back and committed, etc.). Does the .Net code commit the transaction after the SP has already committed it? Does the .Net code roll it back on encountering an error, then attempt to roll it back again in a catch (or finally) clause?

有可能从未在旧服务器上遇到错误情况,因此从未遇到过错误的双回滚"代码.也许现在您遇到的情况是,新服务器上存在 一些配置错误,并且现在错误代码已通过异常处理被发现.

It's possible an error condition was never being hit on the old server, and thus the faulty "double rollback" code was never hit. Maybe now you have a situation where there is some configuration error on the new server, and now the faulty code is getting hit via exception handling.

您可以调试错误代码吗?您有堆栈跟踪吗?

Can you debug into the error code? Do you have a stack trace?

这篇关于"此SqlTransaction已完成;它不再可用."...配置错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆