Devart Oracle 提供程序直接模式的参数化查询问题
我在直接模式下的参数化查询遇到一些奇怪的问题。
基本上,如果我对已经包含唯一行的表执行插入,我会收到预期的插入异常。在插入异常之后,我使用相同的连接来获取已锁定数据的信息以报告用户(我知道此时连接仍然良好)。然后关闭该连接并返回到池中,到目前为止,所有这些都按预期正常进行。
稍后,当从池中夺回此连接时,我尝试执行简单的更新参数化查询,但出现以下异常:ORA-01008:并非所有变量都绑定。如果所有变量都没有绑定,那么这是有意义的,但是查看 OracleParameter 集合,我可以清楚地看到所有参数都存在并且它们的值都是正确的。更不用说在从池中获取此连接以供池中其他连接使用之前,此查询会运行多次,因为它是针对每个客户端请求进行更新的通用更新表。此外,在使用 Oracle 客户端关闭直接模式的情况下,所有这些代码都可以正常工作(与直接模式下的代码和查询执行完全相同)。
基本上,似乎由于某种原因,在直接模式下,当执行插入并失败并且连接被关闭并放回到池中时,连接会损坏并在再次与参数化查询一起使用时失败。
我会生成一个简单的示例,但唯一的问题是这个问题在简单的情况下不能可靠地重现。
信息:
- 这是一个客户端服务器应用程序。即使只有一个客户端也会出现问题。
- 为每个客户端请求创建连接并从池中获取连接,并在执行请求后关闭连接。
- 每个连接都在单个线程中使用(而不是跨多个线程)
- 使用最新的 Devart.Data.Oracle 5.35.54 和 Devart.Data 5.0.16,我也尝试过使用以前的版本获得相同的结果。
如果有人遇到过这个或有任何想法,我们将不胜感激您的帮助,
谢谢
I'm having some bizarre issues with parametrized queries in direct mode.
Basically if I perform an insert on a table that already contains a unique row I get an insert exception which is expected. After the insert exception I use this same connection to grab the info for which data is already locked down to report the user (I know the connection is still good at this point). This connection is then closed and returned to the pool all of this is fine up to this point as expected.
At a later point in time when this connection is grabbed back from the pool I try to perform a simple update parametrized query and I get the following exception: ORA-01008: not all variables bound. This would make sense to get if all variables were not bound however looking at the OracleParameter collection I can clearly see that all parameters exist and that their values are correct. Not to mention this query gets run multiple times before this connection is grabbed from the pool for other connections in the pool since it's a general update table that gets updated for each client request. Furthermore all of this code works fine with direct mode turned off using the oracle client (exact same code and query execution as in direct mode).
Basically it seems that for some reason in direct mode when the insert is performed and fails and the connection gets closed and placed back into the pool that the connection becomes corrupt and fails when used again with parametrized queries.
I would produce a simple sample except the only problem is that this issue is not reliably reproducible in a simple case.
Info:
- This is a client server app. Issue occurs even with a single client.
- Connection is created and grabbed from the pool for each client request and closed after execution of the request.
- Each connection is used within a single thread (not across multiple threads)
- Using the latest Devart.Data.Oracle 5.35.54 and Devart.Data 5.0.16 and i've also tried with the previous version with the same results.
If any one has come across this or has any ideas your help will be greatly appreciated
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我们已在我们的论坛此处回复您。
We have replied you here at our forum.