ADO.NET 事务在第一个连接打开和关闭后不征用命令 [英] ADO.NET Transaction does not enlist commands after first connection is opened and closed

查看:44
本文介绍了ADO.NET 事务在第一个连接打开和关闭后不征用命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我们的一台服务器上使用 Oracle 全局临时表时遇到问题.这是我要完成的任务的详细信息.

I'm having trouble with using an Oracle Global Temporary Table on one of our servers. Here's the details of what I'm trying to accomplish.

  1. 创建 OracleConnection.
  2. 从该连接开始 OracleTransaction.
  3. 创建一个 OracleCommand 以将单个值插入到 Oracle 全局变量中临时表 (GTT).例如插入 MY_GTT (SOME_FIELD) 值 (123);
  4. 在事务和 ExecuteNonQuery 中登记上述命令.
  5. 创建另一个 OracleCommand 以从 Oracle GTT 读取该值.例如从 MY_GTT 中选择 SOME_FIELD;
  6. 在事务和 ExecuteReader 中登记上述命令.
  7. 提交交易.

这个案例适用于我们所有的服务器,除了一个.更奇怪的是,这个测试用例确实在工作人员之后在有问题的服务器上工作进程被回收,但后续请求不起作用.

This case works on all of our servers except one. What is even stranger, is that this test case does work on the server in question after the worker processes are recycled, but subsequent requests do not work.

所以,也许服务器没有正确回收连接或其他东西就这样……

So, maybe the server is not properly recycling the connections or something like that...

推荐答案

我无法追查为什么事务在一台服务器上而不是在另一台服务器上维护.

I wasn't able to track down why the transaction was being maintained on one server but not on the other.

但是,当我使用 Oracle ODP.NET 驱动程序时,一切正常.无法工作的驱动程序是 Microsoft 已弃用的 System.Data.OracleClient 驱动程序.

However, when I used the Oracle ODP.NET driver, everything worked. The driver that was not working was Microsoft's deprecated System.Data.OracleClient driver.

这篇关于ADO.NET 事务在第一个连接打开和关闭后不征用命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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