Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-2584

Creating a database with JPOX SchemaTool sometimes gives ArrayIndexOutOfBoundsException when getIndexInfo() is called

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.2.1.6, 10.2.2.0, 10.3.1.4
    • 10.2.2.1, 10.3.1.4
    • SQL
    • None

    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

        1. d2584.java
          0.9 kB
          Knut Anders Hatlen
        2. initiallyCompilable.diff
          0.7 kB
          Knut Anders Hatlen
        3. derby-2584-v1.diff
          4 kB
          Knut Anders Hatlen
        4. derby-2584-v1.stat
          0.2 kB
          Knut Anders Hatlen

        Issue Links

          Activity

            People

              knutanders Knut Anders Hatlen
              bernt Bernt Johnsen
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: