Java Oracle:OALL8 处于不一致状态
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/679683/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Oracle: OALL8 is in an inconsistent state
提问by Goyuix
As part of upgrading JRun, we are moving from a 1.4 JVM to a 1.6 JVM. Now I am getting a really strange oracle db error: "OALL8 is in an inconsistent state". I have pinned down the problem to insert queries that do not use bind variables at all - all inline parameters. If I run the query without any bind variables, I get the above error. As soon as I replace one of the hard coded values with a bind variable - everything works without error.
作为升级 JRun 的一部分,我们正在从 1.4 JVM 迁移到 1.6 JVM。现在我收到一个非常奇怪的 oracle db 错误:“OALL8 处于不一致状态”。我已经确定了插入根本不使用绑定变量的查询的问题 - 所有内联参数。如果我在没有任何绑定变量的情况下运行查询,则会出现上述错误。一旦我用绑定变量替换硬编码值之一 - 一切正常。
The other strange bit is that after executing the query, it is in fact committed to the database. I can connect from another session and see the inserted row. I have tried wrapping the query in a transaction and it seems to succeed as the behavior is unchanged from the query without an explicit transaction.
另一个奇怪的地方是,在执行查询后,它实际上已提交给数据库。我可以从另一个会话连接并查看插入的行。我尝试将查询包装在一个事务中,它似乎成功了,因为在没有显式事务的情况下,查询的行为没有改变。
Here are the relevant details:
以下是相关详情:
Java Version: 1.6.0_12-b04
Virtual Machine Version: 11.2-b01 (HotSpot Server)
Oracle Server: 10.2.0.4
Oracle Client: 11.1.0.7.0 through ojdbc6.jar
Java 版本:1.6.0_12-b04
虚拟机版本:11.2-b01(HotSpot 服务器)
Oracle 服务器:10.2.0.4
Oracle 客户端:11.1.0.7.0 到 ojdbc6.jar
Update:I am using cfqueryparam - they are called bind variables in the oracle world. While that does solve the immediate problem, we have a rather large legacy code base that we can't realistically go through all of to update the queries as part of upgrading from CF7 to CF8.
更新:我正在使用 cfqueryparam - 它们在 oracle 世界中被称为绑定变量。虽然这确实解决了当前的问题,但我们有一个相当大的遗留代码库,作为从 CF7 升级到 CF8 的一部分,我们实际上无法通过所有这些代码来更新查询。
Even though I have pinned down one specific situation that fails (and encapsulated it in an mxunit test) - that doesn't mean there aren't other areas where this may be an issue. I would really like to have a solution in place that removes the OALL8 error rather than coding around it.
即使我已经确定了一个失败的特定情况(并将其封装在 mxunit 测试中) - 这并不意味着没有其他领域可能会出现问题。我真的很想有一个解决方案来消除 OALL8 错误,而不是围绕它编码。
Update 2:After checking with our DBA he had set a parameter called CURSOR_SHARING to SIMILAR. The Oracle default is EXACT. What is happening is when ColdFusion hands the query off to be executed, Oracle is turning all the literal values to bind variables and that appears to be confusing ColdFusion. Turning the setting back to EXACT allows the literal queries to work just fine.
更新 2:在与我们的 DBA 核对之后,他将一个名为 CURSOR_SHARING 的参数设置为 SIMILAR。Oracle 默认值为 EXACT。发生的情况是,当 ColdFusion 将查询交给执行时,Oracle 正在将所有文字值转换为绑定变量,这似乎使 ColdFusion 感到困惑。将设置转回 EXACT 允许文字查询正常工作。
Update 3:Oracle finally issued us an out-of-band patch for JDBC. It was identified as a JDBC error. The latest drivers should include it when they are finally updated. If you have support you can also request the patch through their TAR system.
更新 3:Oracle 终于向我们发布了一个针对 JDBC 的带外补丁。它被识别为 JDBC 错误。最新的驱动程序在最终更新时应该包含它。如果您有支持,您还可以通过他们的 TAR 系统请求补丁。
采纳答案by Peter Boughton
So... use bind variables?
所以...使用绑定变量?
You should be using them (via cfqueryparam
) for security anyway, and if it solves the problem that's even more reason to do so.
cfqueryparam
无论如何,您应该将它们(通过)用于安全性,如果它解决了问题,那就更有理由这样做了。
If you're interested in what the actual error means, Google has plentyofresults, suggesting that it's an error with the JDBC driver, and even suggests a patch is available.
如果你有兴趣在实际的错误是什么意思,谷歌有很多的结果,这表明它是一个与JDBC驱动程序错误,甚至提出一个补丁可用。
But I don't see an actual question in your post...?
但是我在您的帖子中没有看到实际问题......?
回答by Diego Alvarez
i found this http://asanga-pradeep.blogspot.com/2008/06/oall8-is-in-inconsistent-state-with.html
我发现这个http://asanga-pradeep.blogspot.com/2008/06/oall8-is-in-inconsistent-state-with.html
Oracle Patch 4390875
Oracle 补丁 4390875
回答by billni
If you application run in weblogic, you should copy ojdbc.jar to install directory "weblogic81\server\lib" , cover the same name file.
如果你的应用程序运行在weblogic中,你应该将ojdbc.jar复制到安装目录“weblogic81\server\lib”,覆盖同名文件。