非链式交易模式

发布于 2024-11-19 16:55:35 字数 262 浏览 1 评论 0原文

当我使用 .net transaction 在 .net transaction 下运行一段代码时出现此错误

tran = 连接.BeginTransaction();

错误=> “存储过程‘pr_xxxxx’只能在非链式事务模式下运行。‘SET CHAINED OFF’命令将导致当前会话使用非链式事务模式”。

如何在交易中设置链式/非链式模式?我使用 ODBC 连接,我的数据库是 sybase

Am getting this error when I run a piece of code under .net transaction using

tran = connection.BeginTransaction();

Error=> "Stored procedure 'pr_xxxxx' may be run only in unchained transaction mode The 'SET CHAINED OFF' command will cause the current session to use unchained transaction mode".

How can I set chained/unchained mode in transaction?. Am using ODBC connection and my database is sybase

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清醇 2024-11-26 16:55:35

在执行过程之前,您需要执行 SET CHAINED OFF 命令。此外,您可能需要通过设置 DbCommand.Transaction 属性并手动调用事务对象上的 Commit() 方法来确保禁用自动提交。

You need to execute the SET CHAINED OFF command before you execute your procedure. Also you may need to make sure auto commit is disabled by setting the DbCommand.Transaction property and manually calling the Commit() method on your transaction object.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文