Details
Description
It has been reported (e.g. here: http://www.jpox.org/servlet/forum/viewthread?thread=4034 ) that the database sometimes get corrupt when the db is created with JPOX SchemaTool. This leads to java.lang.ArrayIndexOutOfBoundsException for some (at least one: getIndexInfo) metadata calls. When this happens, the types array GenericParameterValueSet.initialize has length 0.
I have not yet managed to reproduce the bug in a small repro. A workaround exists though: Create the database before you run the JPOX SchemaTool.
The stack trace you get when getIndexInfo is called is
2007-04-17 16:20:20.191 GMT Thread[DRDAConnThread_5,5,main] (XID = 1554), (SESSIONID = 10), (DATABASE = communitymc_portal1), (DRDAID = C0124DC3.H92B-954198994222304164
{11}), Failed Statement is: CALL SYSIBM.SQLSTATISTICS(?,?,?,?,?,?) with 6 parameters begin parameter #1: null :end parameter begin parameter #2: PORTAL :end parameter begin parameter #3: COMMUNITY :end parameter begin parameter #4: 1 :end parameter begin parameter #5: 1 :end parameter begin parameter #6: DATATYPE='JDBC';DYNAMIC=0;REPORTPUBLICPRIVILEGES=1;CURSORHOLD=1 :end parameter
java.lang.ArrayIndexOutOfBoundsException: 0
at org.apache.derby.impl.sql.GenericParameterValueSet.initialize(Unknown Source)
at org.apache.derby.impl.sql.execute.BaseActivation.setupActivation(Unknown Source)
at org.apache.derby.impl.sql.GenericActivationHolder.<init>(Unknown Source)
at org.apache.derby.impl.sql.GenericPreparedStatement.getActivation(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(Unknown Source)
at org.apache.derby.jdbc.Driver30.newEmbedPreparedStatement(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.prepareMetaDataStatement(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedDatabaseMetaData.prepareSPS(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedDatabaseMetaData.getPreparedQueryUsingSystemTables(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedDatabaseMetaData.getPreparedQuery(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedDatabaseMetaData.getPreparedQuery(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedDatabaseMetaData.doGetIndexInfo(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedDatabaseMetaData.getIndexInfo(Unknown Source)
at org.apache.derby.catalog.SystemProcedures.SQLSTATISTICS(Unknown Source)
at org.apache.derby.exe.ac72e9c096x0112x0056x2b09xffffcd3424e39.g0(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.derby.impl.services.reflect.ReflectMethod.invoke(Unknown Source)
at org.apache.derby.impl.sql.execute.CallStatementResultSet.open(Unknown Source)
at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedCallableStatement.executeStatement(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown Source)
at org.apache.derby.impl.drda.DRDAStatement.execute(Unknown Source)
at org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLSTTobjects(Unknown Source)
at org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLSTT(Unknown Source)
at org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown Source)
at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source)
Attachments
Attachments
Issue Links
- is related to
-
DERBY-4773 Derby Network service mode creates a lot of generated classes (extends BaseActivation).
- Open
-
DERBY-177 Unnecessary waiting within EmbedDatabaseMetaData.getIndexInfo()
- Closed
- relates to
-
DERBY-4160 getMetaData().getIndexInfo crashes with "ERROR X0Y68: Column 'PARAM1' already exists."
- Closed
-
DERBY-1996 DatabaseMetaData.getColumns() takes long time to return columns for a particular schema of Apache JDO TCK
- Open