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

查看:36
本文介绍了"此 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 更改后我没有重新启动(在此处提到:http://social.msdn.microsoft.com/forums/en-US/adodotnetdataproviders/thread/7172223f-acbe-4472-8cdf-feec80fd2e64/).

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".

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

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天全站免登陆