SchemaSpy - 生成报告时出现错误消息

问题描述 投票:2回答:4

我正在使用SchemaSpy(5.0.0)生成Informix数据库的报告。在运行它时,我在“收集架构详细信息”的最后一步中收到以下错误:

java.sql.SQLException: The cursor has been previously released and is unavailable.
    at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:408)
    at com.informix.jdbc.IfxSqli.addException(IfxSqli.java:3187)
    at com.informix.jdbc.IfxSqli.receiveError(IfxSqli.java:3467)
    at com.informix.jdbc.IfxSqli.dispatchMsg(IfxSqli.java:2378)
    at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.java:2303)
    at com.informix.jdbc.IfxSqli.executeFetch(IfxSqli.java:2037)
    at com.informix.jdbc.IfxSqli.getaRow(IfxSqli.java:4077)
    at com.informix.jdbc.IfxResultSet.next(IfxResultSet.java:494)
    at com.informix.jdbc.IfxDatabaseMetaData.getImportedKeys(IfxDatabaseMetaData.java:5524)
    at net.sourceforge.schemaspy.model.Table.connectForeignKeys(Table.java:106)
    at net.sourceforge.schemaspy.model.Database.connectTables(Database.java:984)
    at net.sourceforge.schemaspy.model.Database.<init>(Database.java:83)
    at net.sourceforge.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:211)
    at net.sourceforge.schemaspy.Main.main(Main.java:42)
Caused by: java.sql.SQLException
    at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:408)
    at com.informix.jdbc.IfxSqli.receiveError(IfxSqli.java:3472)

我在4.1.0版中使用了Informix JDBC驱动程序(也尝试过4.10.8.1)。奇怪的是,这个驱动程序也需要BSON库。

知道问题是什么?

informix schemaspy
4个回答
0
投票

我在这里回答了类似的问题https://stackoverflow.com/a/55458418/8334122。该答案的副本如下。

我必须得到一些帮助来追踪这个,因为这是一个计时问题+驱动程序中的错误。

这里的问题是Informix JDBC驱动程序的某些版本。快速修复是升级到最新的4.50.1驱动程序。这是在maven上。

<!-- https://mvnrepository.com/artifact/com.ibm.informix/jdbc -->
<dependency>
    <groupId>com.ibm.informix</groupId>
    <artifactId>jdbc</artifactId>
    <version>4.50.1</version>
</dependency>

详细地。 4.10.X驱动程序引入了一个语句清理程序线程,每15秒运行一次,并查找需要关闭的资源,因为它们没有更多引用,可能是垃圾回收。问题,然后复合作为一对JDBC metdata调用错误地无法关闭资源导致这个更干净的线程有时在工作中间关闭资源。因此有些人经常看到它,有些人从不看。您可以使用4.10.JC12解决它,我们添加了一个连接标志来禁用更清洁线程(IFMXCONNECTION_CLEANER_THREADS = 0)。或者最好的选择是升级到最新的4.50.1驱动程序,该驱动程序已正确修复此问题


3
投票

与乔纳森达成100%同意。这应该报告给IBM技术支持。 IBM每年发布大约3个或Fixpacks,我认为没有理由让Informix 12.10用户受到惩罚。打开服务请求会很棒。我喜欢schemaSpy!

埃里克


2
投票

为了将来参考,我可以通过用旧版本替换上面的驱动程序4.X来解决问题。似乎驱动程序有问题,或者SchemaSpy与较新的4.X驱动程序不兼容。工作的驱动程序是最新的3.X驱动程序(确切地说是3.70.JC8)。


0
投票

查看堆栈时,服务器无法执行选择,并在尝试检索主键列表时向客户端返回错误:

java.sql.SQLException: The cursor has been previously released and is unavailable.
    at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:408)
    at com.informix.jdbc.IfxSqli.addException(IfxSqli.java:3187)
    at com.informix.jdbc.IfxSqli.receiveError(IfxSqli.java:3467)    <--- means error ;)
    at com.informix.jdbc.IfxSqli.dispatchMsg(IfxSqli.java:2378)
    at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.java:2303)
    at com.informix.jdbc.IfxSqli.executeFetch(IfxSqli.java:2037)
    at com.informix.jdbc.IfxSqli.getaRow(IfxSqli.java:4077)
    at com.informix.jdbc.IfxResultSet.next(IfxResultSet.java:494)
    at com.informix.jdbc.IfxDatabaseMetaData.getImportedKeys(IfxDatabaseMetaData.java:5524)

我在我的一台服务器上对store_demo数据库进行了4.10.JC8的快速测试,并且完成时没有粗俗:

d:\JJTMP>java -jar \jjtmp\schemaSpy_5.0.0.jar -t informix -db stores7 -s informix -u informix -p password -o \jjtmp -host 420ito:9088 -server ids1210 -dp \infx\jdbc410jc8x\lib\ifxjdbc.jar
Using database properties:
  [\jjtmp\schemaSpy_5.0.0.jar]/net/sourceforge/schemaspy/dbTypes/informix.properties
Gathering schema details....................................................................(4sec)
Writing/graphing summary..............(7sec)
Writing/diagramming details.................................................................(6sec)
Wrote relationship details of 65 tables/views to directory '\jjtmp' in 19 seconds.
View the results by opening \jjtmp\index.html

d:\JJTMP>

如果您获得SQLI跟踪,您应该能够看到特定SQL失败的原因。将SQLIDEBUG属性添加到schemaSpy命令行中的连接字符串以生成一个。像这样的东西:

d:\JJTMP>java -jar \jjtmp\schemaSpy_5.0.0.jar -t informix -db stores7 -s informix -u informix -p password -o \jjtmp -host 420ito:9088 -server ids1210 -dp \infx\jdbc410jc8x1\lib\ifxjdbc.jar -connprops SQLIDEBUG\=trace
Using database properties:
  [\jjtmp\schemaSpy_5.0.0.jar]/net/sourceforge/schemaspy/dbTypes/informix.properties
Gathering schema details....................................................................(4sec)
Writing/graphing summary..............(7sec)
Writing/diagramming details.................................................................(6sec)
Wrote relationship details of 65 tables/views to directory '\jjtmp' in 18 seconds.
View the results by opening \jjtmp\index.html

d:\JJTMP>dir trace*
 Volume in drive D is Data750
 Volume Serial Number is F0B7-2E46

 Directory of d:\JJTMP

17/08/2017  11:10         2,008,706 trace1502964639886.0
               1 File(s)      2,008,706 bytes
               0 Dir(s)  284,868,997,120 bytes free

然后你可以使用sql print / sql import SDK工具解码跟踪文件(它应该在引擎bin目录下)

d:\JJTMP>sqliprt -notimestamp trace1502964639886.0 > trace.txt

d:\JJTMP>

但正如大家所说,打开技术支持可能是一个好主意。它可能特定于您的数据库/模式(想知道它是否对其他数据库失败),但即便这样,getImportedKeys()也不会因为该错误而失败,无论应用程序做什么。

© www.soinside.com 2019 - 2024. All rights reserved.