Derby
  1. Derby
  2. DERBY-5289

Unable to boot 10.5.1.1 database - fails during soft/hard upgrade process for a new version number while trying to drop jdbc metadata

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.1.3.1, 10.2.2.0, 10.3.3.0, 10.4.2.0, 10.5.3.0, 10.6.2.1, 10.7.1.1, 10.8.1.2, 10.9.1.0
    • Component/s: SQL
    • Labels:
      None
    • Environment:
    • Issue & fix info:
      Repro attached
    • Bug behavior facts:
      Regression

      Description

      I have been unable to get Derby 10.7.1.1 and 10.8.1.2 to boot the attached 10.5.1.1 database. Derby 10.6.1.0 is however able to use the DB.

      I'm not sure if this is a backwards compatibility bug or the result of corruption to the database. Running SYSCS_CHECK_TABLE and SYSCS_COMPRESS_TABLE under 10.6.1.0 found no problems with the database.

      NOTE: I have had to remove all data and non-essential tables/columns/triggers/etc prior to attaching this database.

      Output when connecting to the DB using ij:
      ERROR XJ040: Failed to start database 'C:\Users\BMASON\Sandbox\InternalDB' with class loader sun.misc.Launcher$AppClassLoader@11b86e7, see the next exception for details.
      ERROR XSDA7: Restore of a serializable or SQLData object of class , attempted to read more data than was originally stored

      Full exception from our application:
      java.sql.SQLException: Failed to start database 'C:\Users\BMASON\Sandbox\InternalDB' with class loader sun.misc.Launcher$AppClassLoader@93dee9, see the next exception for details.
      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
      at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
      at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown Source)
      at org.apache.derby.impl.jdbc.EmbedConnection40.<init>(Unknown Source)
      at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Unknown Source)
      at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
      at org.apache.derby.jdbc.EmbeddedDataSource.getConnection(Unknown Source)
      at org.apache.derby.jdbc.EmbeddedDataSource.getConnection(Unknown Source)
      at com.ADInstruments.LTS.util.DerbyUtils.exists(DerbyUtils.java:86)
      at com.ADInstruments.LTS.InternalDB.InternalDbUtilities.cacheInternalDbVersion(InternalDbUtilities.java:117)
      at com.ADInstruments.LTCS.InternalDB.InternalDbStartup.initialiseDatabase(InternalDbStartup.java:23)
      at com.ADInstruments.LTCS.StartupTasks$StartupRunnable.initDatabases(StartupTasks.java:35)
      at com.ADInstruments.LTCS.StartupTasks$StartupRunnable.run(StartupTasks.java:52)
      at java.lang.Thread.run(Thread.java:662)
      Caused by: java.sql.SQLException: Failed to start database 'C:\Users\BMASON\Sandbox\InternalDB' with class loader sun.misc.Launcher$AppClassLoader@93dee9, see the next exception for details.
      at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
      ... 17 more
      Caused by: java.sql.SQLException: Restore of a serializable or SQLData object of class , attempted to read more data than was originally stored
      at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
      at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
      at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
      ... 14 more
      Caused by: ERROR XSDA7: Restore of a serializable or SQLData object of class , attempted to read more data than was originally stored
      at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
      at org.apache.derby.impl.store.raw.data.StoredPage.readRecordFromArray(Unknown Source)
      at org.apache.derby.impl.store.raw.data.StoredPage.restoreRecordFromSlot(Unknown Source)
      at org.apache.derby.impl.store.raw.data.BasePage.fetchFromSlot(Unknown Source)
      at org.apache.derby.impl.store.access.conglomerate.GenericScanController.fetchRows(Unknown Source)
      at org.apache.derby.impl.store.access.heap.HeapScan.fetchNext(Unknown Source)
      at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getDescriptorViaHeap(Unknown Source)
      at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getAllSPSDescriptors(Unknown Source)
      at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.dropJDBCMetadataSPSes(Unknown Source)
      at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.updateMetadataSPSes(Unknown Source)
      at org.apache.derby.impl.sql.catalog.DD_Version.handleMinorRevisionChange(Unknown Source)
      at org.apache.derby.impl.sql.catalog.DD_Version.upgradeIfNeeded(Unknown Source)
      at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.loadDictionaryTables(Unknown Source)
      at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.boot(Unknown Source)
      at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
      at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
      at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
      at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unknown Source)
      at org.apache.derby.impl.db.BasicDatabase.boot(Unknown Source)
      at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
      at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
      at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown Source)
      at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(Unknown Source)
      at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService(Unknown Source)
      at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(Unknown Source)
      at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService(Unknown Source)
      ... 14 more
      Caused by: java.io.EOFException
      at java.io.DataInputStream.readInt(DataInputStream.java:375)
      at org.apache.derby.iapi.sql.dictionary.TriggerDescriptor.readExternal(Unknown Source)
      at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(Unknown Source)
      at org.apache.derby.iapi.services.io.ArrayUtil.readArrayItems(Unknown Source)
      at org.apache.derby.impl.sql.execute.TriggerInfo.readExternal(Unknown Source)
      at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(Unknown Source)
      at org.apache.derby.impl.sql.execute.WriteCursorConstantAction.readExternal(Unknown Source)
      at org.apache.derby.impl.sql.execute.UpdateConstantAction.readExternal(Unknown Source)
      at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(Unknown Source)
      at org.apache.derby.impl.sql.GenericStorablePreparedStatement.readExternal(Unknown Source)
      at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(Unknown Source)
      at org.apache.derby.iapi.types.UserType.readExternal(Unknown Source)
      ... 39 more

      1. derby-5289_10_7_diff.txt
        12 kB
        Kathey Marsden
      2. derby-5289_test_diff.txt
        5 kB
        Kathey Marsden
      3. repro.sql
        0.5 kB
        Brett Mason
      4. DERBY5269_patch1_diff.txt
        2 kB
        Mamta A. Satoor
      5. InternalDB - broken for 10.8.zip
        315 kB
        Brett Mason

        Activity

        Hide
        Brett Mason added a comment -

        Trimmed down database which exhibits the problem.

        Show
        Brett Mason added a comment - Trimmed down database which exhibits the problem.
        Hide
        Brett Mason added a comment -

        The database can be booted with 10.8 if the trigger ADMIN_LIST_UPDATE_MARKERS is dropped.

        Show
        Brett Mason added a comment - The database can be booted with 10.8 if the trigger ADMIN_LIST_UPDATE_MARKERS is dropped.
        Hide
        Brett Mason added a comment -

        Just checked and 10.6.2.1 works as expected.

        Let me know if there is any more information I can provide.

        Show
        Brett Mason added a comment - Just checked and 10.6.2.1 works as expected. Let me know if there is any more information I can provide.
        Hide
        Mamta A. Satoor added a comment - - edited

        I tried the attached db with 10.7.1.1 release and ran into same problem as Brett. I tried it with 10.8 codeline(not the released 10.8.1.2) and the database upgraded fine. I will try it with 10.8.1.2 and with the current trunk codeline to see how it behaves there. It looks like the trigger definition for ADMIN_LIST_UPDATE_MARKERS is as follows
        UPDATE EXP_RUNS SET MARKER_USERCODE = LOWER(NEW.USER_CODE) WHERE MARKER_USERCODE = LOWER(OLD.USER_CODE)

        Brett, I wondered if you could post a simple repro to create the database which shows the problem, It can be an ij script or java program, whichever is easy for you. In the mean time, I will investigate the db attached by you. Thanks

        Show
        Mamta A. Satoor added a comment - - edited I tried the attached db with 10.7.1.1 release and ran into same problem as Brett. I tried it with 10.8 codeline(not the released 10.8.1.2) and the database upgraded fine. I will try it with 10.8.1.2 and with the current trunk codeline to see how it behaves there. It looks like the trigger definition for ADMIN_LIST_UPDATE_MARKERS is as follows UPDATE EXP_RUNS SET MARKER_USERCODE = LOWER(NEW.USER_CODE) WHERE MARKER_USERCODE = LOWER(OLD.USER_CODE) Brett, I wondered if you could post a simple repro to create the database which shows the problem, It can be an ij script or java program, whichever is easy for you. In the mean time, I will investigate the db attached by you. Thanks
        Hide
        Mike Matrigali added a comment -

        mamta, did you try a sane server on the 10.7 codeline? Could you post a complete stack from derby.log as the posted stack is incomplete.

        From the stack it looks like this is a hard upgrade issue. Is soft upgrade a problem?

        Is it correct that on upgrade we are reading anything out of the system catlogs for the triggers? With full stack it probably will be clearer where
        the problem is.

        Show
        Mike Matrigali added a comment - mamta, did you try a sane server on the 10.7 codeline? Could you post a complete stack from derby.log as the posted stack is incomplete. From the stack it looks like this is a hard upgrade issue. Is soft upgrade a problem? Is it correct that on upgrade we are reading anything out of the system catlogs for the triggers? With full stack it probably will be clearer where the problem is.
        Hide
        Mamta A. Satoor added a comment -

        Mike write "From the stack it looks like this is a hard upgrade issue. Is soft upgrade a problem? "

        Yes, the stack trace appears to be for hard upgrade. I tried the soft upgrade on the attached db to 10.7.1.1 and saw the same problem.

        Show
        Mamta A. Satoor added a comment - Mike write "From the stack it looks like this is a hard upgrade issue. Is soft upgrade a problem? " Yes, the stack trace appears to be for hard upgrade. I tried the soft upgrade on the attached db to 10.7.1.1 and saw the same problem.
        Hide
        Mamta A. Satoor added a comment -

        I am attaching derby.log with complete stack trace and also copying it here (it is rather long)
        java.sql.SQLException: Failed to start database 'InternalDB' with class loader sun.misc.Launcher$AppClassLoader@5ca65ca6, see the next exception for details.
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:95)
        at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:142)
        at org.apache.derby.impl.jdbc.Util.seeNextException(Util.java:278)
        at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(EmbedConnection.java:2725)
        at org.apache.derby.impl.jdbc.EmbedConnection.<init>(EmbedConnection.java:384)
        at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Driver40.java:68)
        at org.apache.derby.jdbc.InternalDriver.connect(InternalDriver.java:238)
        at org.apache.derby.jdbc.AutoloadedDriver.connect(AutoloadedDriver.java:119)
        at java.sql.DriverManager.getConnection(DriverManager.java:322)
        at java.sql.DriverManager.getConnection(DriverManager.java:297)
        at org.apache.derby.impl.tools.ij.ij.dynamicConnection(ij.java:1503)
        at org.apache.derby.impl.tools.ij.ij.ConnectStatement(ij.java:1333)
        at org.apache.derby.impl.tools.ij.ij.ijStatement(ij.java:1118)
        at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:341)
        at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:261)
        at org.apache.derby.impl.tools.ij.Main.go(Main.java:229)
        at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:184)
        at org.apache.derby.impl.tools.ij.Main.main(Main.java:75)
        at org.apache.derby.tools.ij.main(ij.java:59)
        Caused by: java.sql.SQLException: Failed to start database 'InternalDB' with class loader sun.misc.Launcher$AppClassLoader@5ca65ca6, see the next exception for details.
        at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
        ... 18 more
        Caused by: java.sql.SQLException: Restore of a serializable or SQLData object of class , attempted to read more data than was originally stored
        at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
        at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Util.java:256)
        at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(EmbedConnection.java:2719)
        ... 15 more
        Caused by: ERROR XSDA7: Restore of a serializable or SQLData object of class , attempted to read more data than was originally stored
        at org.apache.derby.iapi.error.StandardException.newException(StandardException.java:296)
        at org.apache.derby.impl.store.raw.data.StoredPage.readRecordFromArray(StoredPage.java:5753)
        at org.apache.derby.impl.store.raw.data.StoredPage.restoreRecordFromSlot(StoredPage.java:1495)
        at org.apache.derby.impl.store.raw.data.BasePage.fetchFromSlot(BasePage.java:438)
        at org.apache.derby.impl.store.access.conglomerate.GenericScanController.fetchRows(GenericScanController.java:759)
        at org.apache.derby.impl.store.access.heap.HeapScan.fetchNext(HeapScan.java:238)
        at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getDescriptorViaHeap(DataDictionaryImpl.java:8832)
        at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getAllSPSDescriptors(DataDictionaryImpl.java:4522)
        at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.dropJDBCMetadataSPSes(DataDictionaryImpl.java:12836)
        at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.updateMetadataSPSes(DataDictionaryImpl.java:12860)
        at org.apache.derby.impl.sql.catalog.DD_Version.handleMinorRevisionChange(DD_Version.java:520)
        at org.apache.derby.impl.sql.catalog.DD_Version.upgradeIfNeeded(DD_Version.java:244)
        at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.loadDictionaryTables(DataDictionaryImpl.java:7124)
        at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.boot(DataDictionaryImpl.java:774)
        at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1979)
        at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:333)
        at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(BaseMonitor.java:531)
        at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Monitor.java:427)
        at org.apache.derby.impl.db.BasicDatabase.boot(BasicDatabase.java:211)
        at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1979)
        at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:333)
        at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(BaseMonitor.java:1816)
        at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(BaseMonitor.java:1682)
        at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService(BaseMonitor.java:1560)
        at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(BaseMonitor.java:979)
        at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService(Monitor.java:550)
        at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(EmbedConnection.java:2686)
        ... 15 more
        Caused by: java.io.EOFException
        at java.io.DataInputStream.readInt(DataInputStream.java:386)
        at org.apache.derby.iapi.sql.dictionary.TriggerDescriptor.readExternal(TriggerDescriptor.java:813)
        at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125)
        at org.apache.derby.iapi.services.io.ArrayUtil.readArrayItems(ArrayUtil.java:115)
        at org.apache.derby.impl.sql.execute.TriggerInfo.readExternal(TriggerInfo.java:235)
        at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125)
        at org.apache.derby.impl.sql.execute.WriteCursorConstantAction.readExternal(WriteCursorConstantAction.java:244)
        at org.apache.derby.impl.sql.execute.UpdateConstantAction.readExternal(UpdateConstantAction.java:171)
        at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125)
        at org.apache.derby.impl.sql.GenericStorablePreparedStatement.readExternal(GenericStorablePreparedStatement.java:226)
        at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125)
        at org.apache.derby.iapi.types.UserType.readExternal(UserType.java:305)
        at org.apache.derby.impl.store.raw.data.StoredPage.readRecordFromArray(StoredPage.java:5639)
        ... 40 more
        ============= begin nested exception, level (1) ===========
        java.sql.SQLException: Restore of a serializable or SQLData object of class , attempted to read more data than was originally stored
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:95)
        at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Util.java:256)
        at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(EmbedConnection.java:2719)
        at org.apache.derby.impl.jdbc.EmbedConnection.<init>(EmbedConnection.java:384)
        at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Driver40.java:68)
        at org.apache.derby.jdbc.InternalDriver.connect(InternalDriver.java:238)
        at org.apache.derby.jdbc.AutoloadedDriver.connect(AutoloadedDriver.java:119)
        at java.sql.DriverManager.getConnection(DriverManager.java:322)
        at java.sql.DriverManager.getConnection(DriverManager.java:297)
        at org.apache.derby.impl.tools.ij.ij.dynamicConnection(ij.java:1503)
        at org.apache.derby.impl.tools.ij.ij.ConnectStatement(ij.java:1333)
        at org.apache.derby.impl.tools.ij.ij.ijStatement(ij.java:1118)
        at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:341)
        at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:261)
        at org.apache.derby.impl.tools.ij.Main.go(Main.java:229)
        at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:184)
        at org.apache.derby.impl.tools.ij.Main.main(Main.java:75)
        at org.apache.derby.tools.ij.main(ij.java:59)
        Caused by: java.sql.SQLException: Restore of a serializable or SQLData object of class , attempted to read more data than was originally stored
        at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
        ... 17 more
        Caused by: ERROR XSDA7: Restore of a serializable or SQLData object of class , attempted to read more data than was originally stored
        at org.apache.derby.iapi.error.StandardException.newException(StandardException.java:296)
        at org.apache.derby.impl.store.raw.data.StoredPage.readRecordFromArray(StoredPage.java:5753)
        at org.apache.derby.impl.store.raw.data.StoredPage.restoreRecordFromSlot(StoredPage.java:1495)
        at org.apache.derby.impl.store.raw.data.BasePage.fetchFromSlot(BasePage.java:438)
        at org.apache.derby.impl.store.access.conglomerate.GenericScanController.fetchRows(GenericScanController.java:759)
        at org.apache.derby.impl.store.access.heap.HeapScan.fetchNext(HeapScan.java:238)
        at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getDescriptorViaHeap(DataDictionaryImpl.java:8832)
        at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getAllSPSDescriptors(DataDictionaryImpl.java:4522)
        at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.dropJDBCMetadataSPSes(DataDictionaryImpl.java:12836)
        at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.updateMetadataSPSes(DataDictionaryImpl.java:12860)
        at org.apache.derby.impl.sql.catalog.DD_Version.handleMinorRevisionChange(DD_Version.java:520)
        at org.apache.derby.impl.sql.catalog.DD_Version.upgradeIfNeeded(DD_Version.java:244)
        at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.loadDictionaryTables(DataDictionaryImpl.java:7124)
        at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.boot(DataDictionaryImpl.java:774)
        at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1979)
        at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:333)
        at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(BaseMonitor.java:531)
        at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Monitor.java:427)
        at org.apache.derby.impl.db.BasicDatabase.boot(BasicDatabase.java:211)
        at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1979)
        at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:333)
        at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(BaseMonitor.java:1816)
        at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(BaseMonitor.java:1682)
        at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService(BaseMonitor.java:1560)
        at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(BaseMonitor.java:979)
        at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService(Monitor.java:550)
        at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(EmbedConnection.java:2686)
        ... 15 more
        Caused by: java.io.EOFException
        at java.io.DataInputStream.readInt(DataInputStream.java:386)
        at org.apache.derby.iapi.sql.dictionary.TriggerDescriptor.readExternal(TriggerDescriptor.java:813)
        at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125)
        at org.apache.derby.iapi.services.io.ArrayUtil.readArrayItems(ArrayUtil.java:115)
        at org.apache.derby.impl.sql.execute.TriggerInfo.readExternal(TriggerInfo.java:235)
        at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125)
        at org.apache.derby.impl.sql.execute.WriteCursorConstantAction.readExternal(WriteCursorConstantAction.java:244)
        at org.apache.derby.impl.sql.execute.UpdateConstantAction.readExternal(UpdateConstantAction.java:171)
        at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125)
        at org.apache.derby.impl.sql.GenericStorablePreparedStatement.readExternal(GenericStorablePreparedStatement.java:226)
        at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125)
        at org.apache.derby.iapi.types.UserType.readExternal(UserType.java:305)
        at org.apache.derby.impl.store.raw.data.StoredPage.readRecordFromArray(StoredPage.java:5639)
        ... 40 more
        ============= end nested exception, level (1) ===========
        ============= begin nested exception, level (2) ===========
        java.sql.SQLException: Restore of a serializable or SQLData object of class , attempted to read more data than was originally stored
        at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
        at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Util.java:256)
        at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(EmbedConnection.java:2719)
        at org.apache.derby.impl.jdbc.EmbedConnection.<init>(EmbedConnection.java:384)
        at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Driver40.java:68)
        at org.apache.derby.jdbc.InternalDriver.connect(InternalDriver.java:238)
        at org.apache.derby.jdbc.AutoloadedDriver.connect(AutoloadedDriver.java:119)
        at java.sql.DriverManager.getConnection(DriverManager.java:322)
        at java.sql.DriverManager.getConnection(DriverManager.java:297)
        at org.apache.derby.impl.tools.ij.ij.dynamicConnection(ij.java:1503)
        at org.apache.derby.impl.tools.ij.ij.ConnectStatement(ij.java:1333)
        at org.apache.derby.impl.tools.ij.ij.ijStatement(ij.java:1118)
        at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:341)
        at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:261)
        at org.apache.derby.impl.tools.ij.Main.go(Main.java:229)
        at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:184)
        at org.apache.derby.impl.tools.ij.Main.main(Main.java:75)
        at org.apache.derby.tools.ij.main(ij.java:59)
        Caused by: ERROR XSDA7: Restore of a serializable or SQLData object of class , attempted to read more data than was originally stored
        at org.apache.derby.iapi.error.StandardException.newException(StandardException.java:296)
        at org.apache.derby.impl.store.raw.data.StoredPage.readRecordFromArray(StoredPage.java:5753)
        at org.apache.derby.impl.store.raw.data.StoredPage.restoreRecordFromSlot(StoredPage.java:1495)
        at org.apache.derby.impl.store.raw.data.BasePage.fetchFromSlot(BasePage.java:438)
        at org.apache.derby.impl.store.access.conglomerate.GenericScanController.fetchRows(GenericScanController.java:759)
        at org.apache.derby.impl.store.access.heap.HeapScan.fetchNext(HeapScan.java:238)
        at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getDescriptorViaHeap(DataDictionaryImpl.java:8832)
        at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getAllSPSDescriptors(DataDictionaryImpl.java:4522)
        at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.dropJDBCMetadataSPSes(DataDictionaryImpl.java:12836)
        at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.updateMetadataSPSes(DataDictionaryImpl.java:12860)
        at org.apache.derby.impl.sql.catalog.DD_Version.handleMinorRevisionChange(DD_Version.java:520)
        at org.apache.derby.impl.sql.catalog.DD_Version.upgradeIfNeeded(DD_Version.java:244)
        at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.loadDictionaryTables(DataDictionaryImpl.java:7124)
        at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.boot(DataDictionaryImpl.java:774)
        at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1979)
        at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:333)
        at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(BaseMonitor.java:531)
        at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Monitor.java:427)
        at org.apache.derby.impl.db.BasicDatabase.boot(BasicDatabase.java:211)
        at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1979)
        at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:333)
        at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(BaseMonitor.java:1816)
        at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(BaseMonitor.java:1682)
        at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService(BaseMonitor.java:1560)
        at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(BaseMonitor.java:979)
        at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService(Monitor.java:550)
        at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(EmbedConnection.java:2686)
        ... 15 more
        Caused by: java.io.EOFException
        at java.io.DataInputStream.readInt(DataInputStream.java:386)
        at org.apache.derby.iapi.sql.dictionary.TriggerDescriptor.readExternal(TriggerDescriptor.java:813)
        at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125)
        at org.apache.derby.iapi.services.io.ArrayUtil.readArrayItems(ArrayUtil.java:115)
        at org.apache.derby.impl.sql.execute.TriggerInfo.readExternal(TriggerInfo.java:235)
        at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125)
        at org.apache.derby.impl.sql.execute.WriteCursorConstantAction.readExternal(WriteCursorConstantAction.java:244)
        at org.apache.derby.impl.sql.execute.UpdateConstantAction.readExternal(UpdateConstantAction.java:171)
        at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125)
        at org.apache.derby.impl.sql.GenericStorablePreparedStatement.readExternal(GenericStorablePreparedStatement.java:226)
        at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125)
        at org.apache.derby.iapi.types.UserType.readExternal(UserType.java:305)
        at org.apache.derby.impl.store.raw.data.StoredPage.readRecordFromArray(StoredPage.java:5639)
        ... 40 more
        ============= end nested exception, level (2) ===========
        ============= begin nested exception, level (3) ===========
        ERROR XSDA7: Restore of a serializable or SQLData object of class , attempted to read more data than was originally stored
        at org.apache.derby.iapi.error.StandardException.newException(StandardException.java:296)
        at org.apache.derby.impl.store.raw.data.StoredPage.readRecordFromArray(StoredPage.java:5753)
        at org.apache.derby.impl.store.raw.data.StoredPage.restoreRecordFromSlot(StoredPage.java:1495)
        at org.apache.derby.impl.store.raw.data.BasePage.fetchFromSlot(BasePage.java:438)
        at org.apache.derby.impl.store.access.conglomerate.GenericScanController.fetchRows(GenericScanController.java:759)
        at org.apache.derby.impl.store.access.heap.HeapScan.fetchNext(HeapScan.java:238)
        at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getDescriptorViaHeap(DataDictionaryImpl.java:8832)
        at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getAllSPSDescriptors(DataDictionaryImpl.java:4522)
        at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.dropJDBCMetadataSPSes(DataDictionaryImpl.java:12836)
        at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.updateMetadataSPSes(DataDictionaryImpl.java:12860)
        at org.apache.derby.impl.sql.catalog.DD_Version.handleMinorRevisionChange(DD_Version.java:520)
        at org.apache.derby.impl.sql.catalog.DD_Version.upgradeIfNeeded(DD_Version.java:244)
        at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.loadDictionaryTables(DataDictionaryImpl.java:7124)
        at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.boot(DataDictionaryImpl.java:774)
        at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1979)
        at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:333)
        at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(BaseMonitor.java:531)
        at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Monitor.java:427)
        at org.apache.derby.impl.db.BasicDatabase.boot(BasicDatabase.java:211)
        at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1979)
        at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:333)
        at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(BaseMonitor.java:1816)
        at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(BaseMonitor.java:1682)
        at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService(BaseMonitor.java:1560)
        at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(BaseMonitor.java:979)
        at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService(Monitor.java:550)
        at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(EmbedConnection.java:2686)
        at org.apache.derby.impl.jdbc.EmbedConnection.<init>(EmbedConnection.java:384)
        at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Driver40.java:68)
        at org.apache.derby.jdbc.InternalDriver.connect(InternalDriver.java:238)
        at org.apache.derby.jdbc.AutoloadedDriver.connect(AutoloadedDriver.java:119)
        at java.sql.DriverManager.getConnection(DriverManager.java:322)
        at java.sql.DriverManager.getConnection(DriverManager.java:297)
        at org.apache.derby.impl.tools.ij.ij.dynamicConnection(ij.java:1503)
        at org.apache.derby.impl.tools.ij.ij.ConnectStatement(ij.java:1333)
        at org.apache.derby.impl.tools.ij.ij.ijStatement(ij.java:1118)
        at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:341)
        at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:261)
        at org.apache.derby.impl.tools.ij.Main.go(Main.java:229)
        at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:184)
        at org.apache.derby.impl.tools.ij.Main.main(Main.java:75)
        at org.apache.derby.tools.ij.main(ij.java:59)
        Caused by: java.io.EOFException
        at java.io.DataInputStream.readInt(DataInputStream.java:386)
        at org.apache.derby.iapi.sql.dictionary.TriggerDescriptor.readExternal(TriggerDescriptor.java:813)
        at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125)
        at org.apache.derby.iapi.services.io.ArrayUtil.readArrayItems(ArrayUtil.java:115)
        at org.apache.derby.impl.sql.execute.TriggerInfo.readExternal(TriggerInfo.java:235)
        at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125)
        at org.apache.derby.impl.sql.execute.WriteCursorConstantAction.readExternal(WriteCursorConstantAction.java:244)
        at org.apache.derby.impl.sql.execute.UpdateConstantAction.readExternal(UpdateConstantAction.java:171)
        at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125)
        at org.apache.derby.impl.sql.GenericStorablePreparedStatement.readExternal(GenericStorablePreparedStatement.java:226)
        at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125)
        at org.apache.derby.iapi.types.UserType.readExternal(UserType.java:305)
        at org.apache.derby.impl.store.raw.data.StoredPage.readRecordFromArray(StoredPage.java:5639)
        ... 40 more
        ============= end nested exception, level (3) ===========
        ============= begin nested exception, level (4) ===========
        java.io.EOFException
        at java.io.DataInputStream.readInt(DataInputStream.java:386)
        at org.apache.derby.iapi.sql.dictionary.TriggerDescriptor.readExternal(TriggerDescriptor.java:813)
        at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125)
        at org.apache.derby.iapi.services.io.ArrayUtil.readArrayItems(ArrayUtil.java:115)
        at org.apache.derby.impl.sql.execute.TriggerInfo.readExternal(TriggerInfo.java:235)
        at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125)
        at org.apache.derby.impl.sql.execute.WriteCursorConstantAction.readExternal(WriteCursorConstantAction.java:244)
        at org.apache.derby.impl.sql.execute.UpdateConstantAction.readExternal(UpdateConstantAction.java:171)
        at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125)
        at org.apache.derby.impl.sql.GenericStorablePreparedStatement.readExternal(GenericStorablePreparedStatement.java:226)
        at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125)
        at org.apache.derby.iapi.types.UserType.readExternal(UserType.java:305)
        at org.apache.derby.impl.store.raw.data.StoredPage.readRecordFromArray(StoredPage.java:5639)
        at org.apache.derby.impl.store.raw.data.StoredPage.restoreRecordFromSlot(StoredPage.java:1495)
        at org.apache.derby.impl.store.raw.data.BasePage.fetchFromSlot(BasePage.java:438)
        at org.apache.derby.impl.store.access.conglomerate.GenericScanController.fetchRows(GenericScanController.java:759)
        at org.apache.derby.impl.store.access.heap.HeapScan.fetchNext(HeapScan.java:238)
        at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getDescriptorViaHeap(DataDictionaryImpl.java:8832)
        at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getAllSPSDescriptors(DataDictionaryImpl.java:4522)
        at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.dropJDBCMetadataSPSes(DataDictionaryImpl.java:12836)
        at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.updateMetadataSPSes(DataDictionaryImpl.java:12860)
        at org.apache.derby.impl.sql.catalog.DD_Version.handleMinorRevisionChange(DD_Version.java:520)
        at org.apache.derby.impl.sql.catalog.DD_Version.upgradeIfNeeded(DD_Version.java:244)
        at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.loadDictionaryTables(DataDictionaryImpl.java:7124)
        at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.boot(DataDictionaryImpl.java:774)
        at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1979)
        at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:333)
        at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(BaseMonitor.java:531)
        at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Monitor.java:427)
        at org.apache.derby.impl.db.BasicDatabase.boot(BasicDatabase.java:211)
        at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1979)
        at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:333)
        at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(BaseMonitor.java:1816)
        at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(BaseMonitor.java:1682)
        at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService(BaseMonitor.java:1560)
        at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(BaseMonitor.java:979)
        at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService(Monitor.java:550)
        at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(EmbedConnection.java:2686)
        at org.apache.derby.impl.jdbc.EmbedConnection.<init>(EmbedConnection.java:384)
        at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Driver40.java:68)
        at org.apache.derby.jdbc.InternalDriver.connect(InternalDriver.java:238)
        at org.apache.derby.jdbc.AutoloadedDriver.connect(AutoloadedDriver.java:119)
        at java.sql.DriverManager.getConnection(DriverManager.java:322)
        at java.sql.DriverManager.getConnection(DriverManager.java:297)
        at org.apache.derby.impl.tools.ij.ij.dynamicConnection(ij.java:1503)
        at org.apache.derby.impl.tools.ij.ij.ConnectStatement(ij.java:1333)
        at org.apache.derby.impl.tools.ij.ij.ijStatement(ij.java:1118)
        at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:341)
        at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:261)
        at org.apache.derby.impl.tools.ij.Main.go(Main.java:229)
        at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:184)
        at org.apache.derby.impl.tools.ij.Main.main(Main.java:75)
        at org.apache.derby.tools.ij.main(ij.java:59)
        ============= end nested exception, level (4) ===========

        Show
        Mamta A. Satoor added a comment - I am attaching derby.log with complete stack trace and also copying it here (it is rather long) java.sql.SQLException: Failed to start database 'InternalDB' with class loader sun.misc.Launcher$AppClassLoader@5ca65ca6, see the next exception for details. at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:95) at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:142) at org.apache.derby.impl.jdbc.Util.seeNextException(Util.java:278) at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(EmbedConnection.java:2725) at org.apache.derby.impl.jdbc.EmbedConnection.<init>(EmbedConnection.java:384) at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Driver40.java:68) at org.apache.derby.jdbc.InternalDriver.connect(InternalDriver.java:238) at org.apache.derby.jdbc.AutoloadedDriver.connect(AutoloadedDriver.java:119) at java.sql.DriverManager.getConnection(DriverManager.java:322) at java.sql.DriverManager.getConnection(DriverManager.java:297) at org.apache.derby.impl.tools.ij.ij.dynamicConnection(ij.java:1503) at org.apache.derby.impl.tools.ij.ij.ConnectStatement(ij.java:1333) at org.apache.derby.impl.tools.ij.ij.ijStatement(ij.java:1118) at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:341) at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:261) at org.apache.derby.impl.tools.ij.Main.go(Main.java:229) at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:184) at org.apache.derby.impl.tools.ij.Main.main(Main.java:75) at org.apache.derby.tools.ij.main(ij.java:59) Caused by: java.sql.SQLException: Failed to start database 'InternalDB' with class loader sun.misc.Launcher$AppClassLoader@5ca65ca6, see the next exception for details. at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45) at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119) at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70) ... 18 more Caused by: java.sql.SQLException: Restore of a serializable or SQLData object of class , attempted to read more data than was originally stored at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45) at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119) at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70) at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Util.java:256) at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(EmbedConnection.java:2719) ... 15 more Caused by: ERROR XSDA7: Restore of a serializable or SQLData object of class , attempted to read more data than was originally stored at org.apache.derby.iapi.error.StandardException.newException(StandardException.java:296) at org.apache.derby.impl.store.raw.data.StoredPage.readRecordFromArray(StoredPage.java:5753) at org.apache.derby.impl.store.raw.data.StoredPage.restoreRecordFromSlot(StoredPage.java:1495) at org.apache.derby.impl.store.raw.data.BasePage.fetchFromSlot(BasePage.java:438) at org.apache.derby.impl.store.access.conglomerate.GenericScanController.fetchRows(GenericScanController.java:759) at org.apache.derby.impl.store.access.heap.HeapScan.fetchNext(HeapScan.java:238) at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getDescriptorViaHeap(DataDictionaryImpl.java:8832) at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getAllSPSDescriptors(DataDictionaryImpl.java:4522) at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.dropJDBCMetadataSPSes(DataDictionaryImpl.java:12836) at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.updateMetadataSPSes(DataDictionaryImpl.java:12860) at org.apache.derby.impl.sql.catalog.DD_Version.handleMinorRevisionChange(DD_Version.java:520) at org.apache.derby.impl.sql.catalog.DD_Version.upgradeIfNeeded(DD_Version.java:244) at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.loadDictionaryTables(DataDictionaryImpl.java:7124) at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.boot(DataDictionaryImpl.java:774) at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1979) at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:333) at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(BaseMonitor.java:531) at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Monitor.java:427) at org.apache.derby.impl.db.BasicDatabase.boot(BasicDatabase.java:211) at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1979) at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:333) at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(BaseMonitor.java:1816) at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(BaseMonitor.java:1682) at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService(BaseMonitor.java:1560) at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(BaseMonitor.java:979) at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService(Monitor.java:550) at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(EmbedConnection.java:2686) ... 15 more Caused by: java.io.EOFException at java.io.DataInputStream.readInt(DataInputStream.java:386) at org.apache.derby.iapi.sql.dictionary.TriggerDescriptor.readExternal(TriggerDescriptor.java:813) at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125) at org.apache.derby.iapi.services.io.ArrayUtil.readArrayItems(ArrayUtil.java:115) at org.apache.derby.impl.sql.execute.TriggerInfo.readExternal(TriggerInfo.java:235) at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125) at org.apache.derby.impl.sql.execute.WriteCursorConstantAction.readExternal(WriteCursorConstantAction.java:244) at org.apache.derby.impl.sql.execute.UpdateConstantAction.readExternal(UpdateConstantAction.java:171) at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125) at org.apache.derby.impl.sql.GenericStorablePreparedStatement.readExternal(GenericStorablePreparedStatement.java:226) at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125) at org.apache.derby.iapi.types.UserType.readExternal(UserType.java:305) at org.apache.derby.impl.store.raw.data.StoredPage.readRecordFromArray(StoredPage.java:5639) ... 40 more ============= begin nested exception, level (1) =========== java.sql.SQLException: Restore of a serializable or SQLData object of class , attempted to read more data than was originally stored at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:95) at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Util.java:256) at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(EmbedConnection.java:2719) at org.apache.derby.impl.jdbc.EmbedConnection.<init>(EmbedConnection.java:384) at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Driver40.java:68) at org.apache.derby.jdbc.InternalDriver.connect(InternalDriver.java:238) at org.apache.derby.jdbc.AutoloadedDriver.connect(AutoloadedDriver.java:119) at java.sql.DriverManager.getConnection(DriverManager.java:322) at java.sql.DriverManager.getConnection(DriverManager.java:297) at org.apache.derby.impl.tools.ij.ij.dynamicConnection(ij.java:1503) at org.apache.derby.impl.tools.ij.ij.ConnectStatement(ij.java:1333) at org.apache.derby.impl.tools.ij.ij.ijStatement(ij.java:1118) at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:341) at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:261) at org.apache.derby.impl.tools.ij.Main.go(Main.java:229) at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:184) at org.apache.derby.impl.tools.ij.Main.main(Main.java:75) at org.apache.derby.tools.ij.main(ij.java:59) Caused by: java.sql.SQLException: Restore of a serializable or SQLData object of class , attempted to read more data than was originally stored at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45) at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119) at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70) ... 17 more Caused by: ERROR XSDA7: Restore of a serializable or SQLData object of class , attempted to read more data than was originally stored at org.apache.derby.iapi.error.StandardException.newException(StandardException.java:296) at org.apache.derby.impl.store.raw.data.StoredPage.readRecordFromArray(StoredPage.java:5753) at org.apache.derby.impl.store.raw.data.StoredPage.restoreRecordFromSlot(StoredPage.java:1495) at org.apache.derby.impl.store.raw.data.BasePage.fetchFromSlot(BasePage.java:438) at org.apache.derby.impl.store.access.conglomerate.GenericScanController.fetchRows(GenericScanController.java:759) at org.apache.derby.impl.store.access.heap.HeapScan.fetchNext(HeapScan.java:238) at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getDescriptorViaHeap(DataDictionaryImpl.java:8832) at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getAllSPSDescriptors(DataDictionaryImpl.java:4522) at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.dropJDBCMetadataSPSes(DataDictionaryImpl.java:12836) at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.updateMetadataSPSes(DataDictionaryImpl.java:12860) at org.apache.derby.impl.sql.catalog.DD_Version.handleMinorRevisionChange(DD_Version.java:520) at org.apache.derby.impl.sql.catalog.DD_Version.upgradeIfNeeded(DD_Version.java:244) at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.loadDictionaryTables(DataDictionaryImpl.java:7124) at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.boot(DataDictionaryImpl.java:774) at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1979) at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:333) at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(BaseMonitor.java:531) at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Monitor.java:427) at org.apache.derby.impl.db.BasicDatabase.boot(BasicDatabase.java:211) at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1979) at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:333) at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(BaseMonitor.java:1816) at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(BaseMonitor.java:1682) at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService(BaseMonitor.java:1560) at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(BaseMonitor.java:979) at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService(Monitor.java:550) at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(EmbedConnection.java:2686) ... 15 more Caused by: java.io.EOFException at java.io.DataInputStream.readInt(DataInputStream.java:386) at org.apache.derby.iapi.sql.dictionary.TriggerDescriptor.readExternal(TriggerDescriptor.java:813) at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125) at org.apache.derby.iapi.services.io.ArrayUtil.readArrayItems(ArrayUtil.java:115) at org.apache.derby.impl.sql.execute.TriggerInfo.readExternal(TriggerInfo.java:235) at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125) at org.apache.derby.impl.sql.execute.WriteCursorConstantAction.readExternal(WriteCursorConstantAction.java:244) at org.apache.derby.impl.sql.execute.UpdateConstantAction.readExternal(UpdateConstantAction.java:171) at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125) at org.apache.derby.impl.sql.GenericStorablePreparedStatement.readExternal(GenericStorablePreparedStatement.java:226) at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125) at org.apache.derby.iapi.types.UserType.readExternal(UserType.java:305) at org.apache.derby.impl.store.raw.data.StoredPage.readRecordFromArray(StoredPage.java:5639) ... 40 more ============= end nested exception, level (1) =========== ============= begin nested exception, level (2) =========== java.sql.SQLException: Restore of a serializable or SQLData object of class , attempted to read more data than was originally stored at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45) at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119) at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70) at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Util.java:256) at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(EmbedConnection.java:2719) at org.apache.derby.impl.jdbc.EmbedConnection.<init>(EmbedConnection.java:384) at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Driver40.java:68) at org.apache.derby.jdbc.InternalDriver.connect(InternalDriver.java:238) at org.apache.derby.jdbc.AutoloadedDriver.connect(AutoloadedDriver.java:119) at java.sql.DriverManager.getConnection(DriverManager.java:322) at java.sql.DriverManager.getConnection(DriverManager.java:297) at org.apache.derby.impl.tools.ij.ij.dynamicConnection(ij.java:1503) at org.apache.derby.impl.tools.ij.ij.ConnectStatement(ij.java:1333) at org.apache.derby.impl.tools.ij.ij.ijStatement(ij.java:1118) at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:341) at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:261) at org.apache.derby.impl.tools.ij.Main.go(Main.java:229) at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:184) at org.apache.derby.impl.tools.ij.Main.main(Main.java:75) at org.apache.derby.tools.ij.main(ij.java:59) Caused by: ERROR XSDA7: Restore of a serializable or SQLData object of class , attempted to read more data than was originally stored at org.apache.derby.iapi.error.StandardException.newException(StandardException.java:296) at org.apache.derby.impl.store.raw.data.StoredPage.readRecordFromArray(StoredPage.java:5753) at org.apache.derby.impl.store.raw.data.StoredPage.restoreRecordFromSlot(StoredPage.java:1495) at org.apache.derby.impl.store.raw.data.BasePage.fetchFromSlot(BasePage.java:438) at org.apache.derby.impl.store.access.conglomerate.GenericScanController.fetchRows(GenericScanController.java:759) at org.apache.derby.impl.store.access.heap.HeapScan.fetchNext(HeapScan.java:238) at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getDescriptorViaHeap(DataDictionaryImpl.java:8832) at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getAllSPSDescriptors(DataDictionaryImpl.java:4522) at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.dropJDBCMetadataSPSes(DataDictionaryImpl.java:12836) at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.updateMetadataSPSes(DataDictionaryImpl.java:12860) at org.apache.derby.impl.sql.catalog.DD_Version.handleMinorRevisionChange(DD_Version.java:520) at org.apache.derby.impl.sql.catalog.DD_Version.upgradeIfNeeded(DD_Version.java:244) at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.loadDictionaryTables(DataDictionaryImpl.java:7124) at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.boot(DataDictionaryImpl.java:774) at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1979) at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:333) at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(BaseMonitor.java:531) at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Monitor.java:427) at org.apache.derby.impl.db.BasicDatabase.boot(BasicDatabase.java:211) at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1979) at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:333) at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(BaseMonitor.java:1816) at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(BaseMonitor.java:1682) at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService(BaseMonitor.java:1560) at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(BaseMonitor.java:979) at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService(Monitor.java:550) at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(EmbedConnection.java:2686) ... 15 more Caused by: java.io.EOFException at java.io.DataInputStream.readInt(DataInputStream.java:386) at org.apache.derby.iapi.sql.dictionary.TriggerDescriptor.readExternal(TriggerDescriptor.java:813) at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125) at org.apache.derby.iapi.services.io.ArrayUtil.readArrayItems(ArrayUtil.java:115) at org.apache.derby.impl.sql.execute.TriggerInfo.readExternal(TriggerInfo.java:235) at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125) at org.apache.derby.impl.sql.execute.WriteCursorConstantAction.readExternal(WriteCursorConstantAction.java:244) at org.apache.derby.impl.sql.execute.UpdateConstantAction.readExternal(UpdateConstantAction.java:171) at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125) at org.apache.derby.impl.sql.GenericStorablePreparedStatement.readExternal(GenericStorablePreparedStatement.java:226) at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125) at org.apache.derby.iapi.types.UserType.readExternal(UserType.java:305) at org.apache.derby.impl.store.raw.data.StoredPage.readRecordFromArray(StoredPage.java:5639) ... 40 more ============= end nested exception, level (2) =========== ============= begin nested exception, level (3) =========== ERROR XSDA7: Restore of a serializable or SQLData object of class , attempted to read more data than was originally stored at org.apache.derby.iapi.error.StandardException.newException(StandardException.java:296) at org.apache.derby.impl.store.raw.data.StoredPage.readRecordFromArray(StoredPage.java:5753) at org.apache.derby.impl.store.raw.data.StoredPage.restoreRecordFromSlot(StoredPage.java:1495) at org.apache.derby.impl.store.raw.data.BasePage.fetchFromSlot(BasePage.java:438) at org.apache.derby.impl.store.access.conglomerate.GenericScanController.fetchRows(GenericScanController.java:759) at org.apache.derby.impl.store.access.heap.HeapScan.fetchNext(HeapScan.java:238) at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getDescriptorViaHeap(DataDictionaryImpl.java:8832) at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getAllSPSDescriptors(DataDictionaryImpl.java:4522) at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.dropJDBCMetadataSPSes(DataDictionaryImpl.java:12836) at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.updateMetadataSPSes(DataDictionaryImpl.java:12860) at org.apache.derby.impl.sql.catalog.DD_Version.handleMinorRevisionChange(DD_Version.java:520) at org.apache.derby.impl.sql.catalog.DD_Version.upgradeIfNeeded(DD_Version.java:244) at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.loadDictionaryTables(DataDictionaryImpl.java:7124) at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.boot(DataDictionaryImpl.java:774) at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1979) at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:333) at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(BaseMonitor.java:531) at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Monitor.java:427) at org.apache.derby.impl.db.BasicDatabase.boot(BasicDatabase.java:211) at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1979) at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:333) at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(BaseMonitor.java:1816) at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(BaseMonitor.java:1682) at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService(BaseMonitor.java:1560) at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(BaseMonitor.java:979) at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService(Monitor.java:550) at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(EmbedConnection.java:2686) at org.apache.derby.impl.jdbc.EmbedConnection.<init>(EmbedConnection.java:384) at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Driver40.java:68) at org.apache.derby.jdbc.InternalDriver.connect(InternalDriver.java:238) at org.apache.derby.jdbc.AutoloadedDriver.connect(AutoloadedDriver.java:119) at java.sql.DriverManager.getConnection(DriverManager.java:322) at java.sql.DriverManager.getConnection(DriverManager.java:297) at org.apache.derby.impl.tools.ij.ij.dynamicConnection(ij.java:1503) at org.apache.derby.impl.tools.ij.ij.ConnectStatement(ij.java:1333) at org.apache.derby.impl.tools.ij.ij.ijStatement(ij.java:1118) at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:341) at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:261) at org.apache.derby.impl.tools.ij.Main.go(Main.java:229) at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:184) at org.apache.derby.impl.tools.ij.Main.main(Main.java:75) at org.apache.derby.tools.ij.main(ij.java:59) Caused by: java.io.EOFException at java.io.DataInputStream.readInt(DataInputStream.java:386) at org.apache.derby.iapi.sql.dictionary.TriggerDescriptor.readExternal(TriggerDescriptor.java:813) at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125) at org.apache.derby.iapi.services.io.ArrayUtil.readArrayItems(ArrayUtil.java:115) at org.apache.derby.impl.sql.execute.TriggerInfo.readExternal(TriggerInfo.java:235) at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125) at org.apache.derby.impl.sql.execute.WriteCursorConstantAction.readExternal(WriteCursorConstantAction.java:244) at org.apache.derby.impl.sql.execute.UpdateConstantAction.readExternal(UpdateConstantAction.java:171) at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125) at org.apache.derby.impl.sql.GenericStorablePreparedStatement.readExternal(GenericStorablePreparedStatement.java:226) at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125) at org.apache.derby.iapi.types.UserType.readExternal(UserType.java:305) at org.apache.derby.impl.store.raw.data.StoredPage.readRecordFromArray(StoredPage.java:5639) ... 40 more ============= end nested exception, level (3) =========== ============= begin nested exception, level (4) =========== java.io.EOFException at java.io.DataInputStream.readInt(DataInputStream.java:386) at org.apache.derby.iapi.sql.dictionary.TriggerDescriptor.readExternal(TriggerDescriptor.java:813) at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125) at org.apache.derby.iapi.services.io.ArrayUtil.readArrayItems(ArrayUtil.java:115) at org.apache.derby.impl.sql.execute.TriggerInfo.readExternal(TriggerInfo.java:235) at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125) at org.apache.derby.impl.sql.execute.WriteCursorConstantAction.readExternal(WriteCursorConstantAction.java:244) at org.apache.derby.impl.sql.execute.UpdateConstantAction.readExternal(UpdateConstantAction.java:171) at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125) at org.apache.derby.impl.sql.GenericStorablePreparedStatement.readExternal(GenericStorablePreparedStatement.java:226) at org.apache.derby.iapi.services.io.FormatIdInputStream.readObject(FormatIdInputStream.java:125) at org.apache.derby.iapi.types.UserType.readExternal(UserType.java:305) at org.apache.derby.impl.store.raw.data.StoredPage.readRecordFromArray(StoredPage.java:5639) at org.apache.derby.impl.store.raw.data.StoredPage.restoreRecordFromSlot(StoredPage.java:1495) at org.apache.derby.impl.store.raw.data.BasePage.fetchFromSlot(BasePage.java:438) at org.apache.derby.impl.store.access.conglomerate.GenericScanController.fetchRows(GenericScanController.java:759) at org.apache.derby.impl.store.access.heap.HeapScan.fetchNext(HeapScan.java:238) at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getDescriptorViaHeap(DataDictionaryImpl.java:8832) at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getAllSPSDescriptors(DataDictionaryImpl.java:4522) at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.dropJDBCMetadataSPSes(DataDictionaryImpl.java:12836) at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.updateMetadataSPSes(DataDictionaryImpl.java:12860) at org.apache.derby.impl.sql.catalog.DD_Version.handleMinorRevisionChange(DD_Version.java:520) at org.apache.derby.impl.sql.catalog.DD_Version.upgradeIfNeeded(DD_Version.java:244) at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.loadDictionaryTables(DataDictionaryImpl.java:7124) at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.boot(DataDictionaryImpl.java:774) at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1979) at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:333) at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(BaseMonitor.java:531) at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Monitor.java:427) at org.apache.derby.impl.db.BasicDatabase.boot(BasicDatabase.java:211) at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1979) at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:333) at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(BaseMonitor.java:1816) at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(BaseMonitor.java:1682) at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService(BaseMonitor.java:1560) at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(BaseMonitor.java:979) at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService(Monitor.java:550) at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(EmbedConnection.java:2686) at org.apache.derby.impl.jdbc.EmbedConnection.<init>(EmbedConnection.java:384) at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Driver40.java:68) at org.apache.derby.jdbc.InternalDriver.connect(InternalDriver.java:238) at org.apache.derby.jdbc.AutoloadedDriver.connect(AutoloadedDriver.java:119) at java.sql.DriverManager.getConnection(DriverManager.java:322) at java.sql.DriverManager.getConnection(DriverManager.java:297) at org.apache.derby.impl.tools.ij.ij.dynamicConnection(ij.java:1503) at org.apache.derby.impl.tools.ij.ij.ConnectStatement(ij.java:1333) at org.apache.derby.impl.tools.ij.ij.ijStatement(ij.java:1118) at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:341) at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:261) at org.apache.derby.impl.tools.ij.Main.go(Main.java:229) at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:184) at org.apache.derby.impl.tools.ij.Main.main(Main.java:75) at org.apache.derby.tools.ij.main(ij.java:59) ============= end nested exception, level (4) ===========
        Hide
        Brett Mason added a comment -

        Thanks for taking a look so quickly. I haven't been able to reproduce the issue with a fresh DB so far but I will keep trying. I will also try upgrading a range of other databases we have available to see if any others exhibit the problem.

        The attached database was a development database I used for load testing so it would have had quite a bit of use, particularly the EXP_RUNS table.

        Show
        Brett Mason added a comment - Thanks for taking a look so quickly. I haven't been able to reproduce the issue with a fresh DB so far but I will keep trying. I will also try upgrading a range of other databases we have available to see if any others exhibit the problem. The attached database was a development database I used for load testing so it would have had quite a bit of use, particularly the EXP_RUNS table.
        Hide
        Mamta A. Satoor added a comment -

        I tried dblook on the attached db and got following
        $ java org.apache.derby.tools.dblook -d 'jdbc:derby:InternalDB'
        – Timestamp: 2011-06-21 13:26:02.351
        – Source database is: InternalDB
        – Connection URL is: jdbc:derby:InternalDB
        – appendLogs: false

        – ----------------------------------------------
        – DDL Statements for schemas
        – ----------------------------------------------

        CREATE SCHEMA "SYNC";

        – ----------------------------------------------
        – DDL Statements for functions
        – ----------------------------------------------

        CREATE FUNCTION "SYNC"."XML_ENCODE" ("ELEM_NAME" VARCHAR(100),"STR" VARCHAR(32672)) RETURNS VARCHAR(32672) LANGUAGE JAVA PARAMETER STYLE JAVA NO SQL CALLED ON NULL INPUT EXTERNAL NAME 'com.ADInstruments.LTS.InternalDB.dbSync.record.UtilityProcedures.xmlEncode' ;

        CREATE FUNCTION "SYNC"."XML_ENCODE_CHAR" ("ELEM_NAME" VARCHAR(100),"VAL" CHAR(1)) RETURNS VARCHAR(32672) LANGUAGE JAVA PARAMETER STYLE JAVA NO SQL CALLED ON NULL INPUT EXTERNAL NAME 'com.ADInstruments.LTS.InternalDB.dbSync.record.UtilityProcedures.xmlEncode' ;

        CREATE FUNCTION "SYNC"."XML_ENCODE_INT" ("ELEM_NAME" VARCHAR(100),"VAL" INTEGER) RETURNS VARCHAR(32672) LANGUAGE JAVA PARAMETER STYLE JAVA NO SQL CALLED ON NULL INPUT EXTERNAL NAME 'com.ADInstruments.LTS.InternalDB.dbSync.record.UtilityProcedures.xmlEncode' ;

        CREATE FUNCTION "SYNC"."XML_ENCODE_BIGINT" ("ELEM_NAME" VARCHAR(100),"VAL" BIGINT) RETURNS VARCHAR(32672) LANGUAGE JAVA PARAMETER STYLE JAVA NO SQL CALLED ON NULL INPUT EXTERNAL NAME 'com.ADInstruments.LTS.InternalDB.dbSync.record.UtilityProcedures.xmlEncode' ;

        CREATE FUNCTION "SYNC"."XML_ENCODE_DOUBLE" ("ELEM_NAME" VARCHAR(100),"VAL" DOUBLE) RETURNS VARCHAR(32672) LANGUAGE JAVA PARAMETER STYLE JAVA NO SQL CALLED ON NULL INPUT EXTERNAL NAME 'com.ADInstruments.LTS.InternalDB.dbSync.record.UtilityProcedures.xmlEncode' ;

        CREATE FUNCTION "SYNC"."XML_ENCODE_TIMESTAMP" ("ELEM_NAME" VARCHAR(100),"VAL" TIMESTAMP) RETURNS VARCHAR(32672) LANGUAGE JAVA PARAMETER STYLE JAVA NO SQL CALLED ON NULL INPUT EXTERNAL NAME 'com.ADInstruments.LTS.InternalDB.dbSync.record.UtilityProcedures.xmlEncode' ;

        CREATE FUNCTION "SYNC"."RANDOM_UUID" () RETURNS VARCHAR(100) LANGUAGE JAVA PARAMETER STYLE JAVA NO SQL RETURNS NULL ON NULL INPUT EXTERNAL NAME 'com.ADInstruments.LTS.InternalDB.dbSync.record.UtilityProcedures.randomUUID' ;

        – ----------------------------------------------
        – DDL Statements for tables
        – ----------------------------------------------

        CREATE TABLE "APP"."ADMIN_LIST" ("ADMIN_ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), "USER_CODE" VARCHAR(255) NOT NULL);

        CREATE TABLE "APP"."EXP_RUNS" ("RUN_ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), "MARKER_USERCODE" VARCHAR(255));

        – ----------------------------------------------
        – DDL Statements for keys
        – ----------------------------------------------

        – primary/unique
        ALTER TABLE "APP"."EXP_RUNS" ADD CONSTRAINT "RUN_PK" PRIMARY KEY ("RUN_ID");

        ALTER TABLE "APP"."ADMIN_LIST" ADD CONSTRAINT "ADMIN_LIST_USER_CODE_UC" UNIQUE ("USER_CODE");

        ALTER TABLE "APP"."ADMIN_LIST" ADD CONSTRAINT "ADMIN_PK" PRIMARY KEY ("ADMIN_ID");

        – ----------------------------------------------
        – DDL Statements for triggers
        – ----------------------------------------------

        CREATE TRIGGER "APP"."ADMIN_LIST_UPDATE_MARKERS" AFTER UPDATE ON "APP"."ADMIN_LIST" REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW UPDATE EXP_RUNS SET MARKER_USERCODE = LOWER(NEW.USER_CODE) WHERE MARKER_USERCODE = LOWER(OLD.USER_CODE);

        Show
        Mamta A. Satoor added a comment - I tried dblook on the attached db and got following $ java org.apache.derby.tools.dblook -d 'jdbc:derby:InternalDB' – Timestamp: 2011-06-21 13:26:02.351 – Source database is: InternalDB – Connection URL is: jdbc:derby:InternalDB – appendLogs: false – ---------------------------------------------- – DDL Statements for schemas – ---------------------------------------------- CREATE SCHEMA "SYNC"; – ---------------------------------------------- – DDL Statements for functions – ---------------------------------------------- CREATE FUNCTION "SYNC"."XML_ENCODE" ("ELEM_NAME" VARCHAR(100),"STR" VARCHAR(32672)) RETURNS VARCHAR(32672) LANGUAGE JAVA PARAMETER STYLE JAVA NO SQL CALLED ON NULL INPUT EXTERNAL NAME 'com.ADInstruments.LTS.InternalDB.dbSync.record.UtilityProcedures.xmlEncode' ; CREATE FUNCTION "SYNC"."XML_ENCODE_CHAR" ("ELEM_NAME" VARCHAR(100),"VAL" CHAR(1)) RETURNS VARCHAR(32672) LANGUAGE JAVA PARAMETER STYLE JAVA NO SQL CALLED ON NULL INPUT EXTERNAL NAME 'com.ADInstruments.LTS.InternalDB.dbSync.record.UtilityProcedures.xmlEncode' ; CREATE FUNCTION "SYNC"."XML_ENCODE_INT" ("ELEM_NAME" VARCHAR(100),"VAL" INTEGER) RETURNS VARCHAR(32672) LANGUAGE JAVA PARAMETER STYLE JAVA NO SQL CALLED ON NULL INPUT EXTERNAL NAME 'com.ADInstruments.LTS.InternalDB.dbSync.record.UtilityProcedures.xmlEncode' ; CREATE FUNCTION "SYNC"."XML_ENCODE_BIGINT" ("ELEM_NAME" VARCHAR(100),"VAL" BIGINT) RETURNS VARCHAR(32672) LANGUAGE JAVA PARAMETER STYLE JAVA NO SQL CALLED ON NULL INPUT EXTERNAL NAME 'com.ADInstruments.LTS.InternalDB.dbSync.record.UtilityProcedures.xmlEncode' ; CREATE FUNCTION "SYNC"."XML_ENCODE_DOUBLE" ("ELEM_NAME" VARCHAR(100),"VAL" DOUBLE) RETURNS VARCHAR(32672) LANGUAGE JAVA PARAMETER STYLE JAVA NO SQL CALLED ON NULL INPUT EXTERNAL NAME 'com.ADInstruments.LTS.InternalDB.dbSync.record.UtilityProcedures.xmlEncode' ; CREATE FUNCTION "SYNC"."XML_ENCODE_TIMESTAMP" ("ELEM_NAME" VARCHAR(100),"VAL" TIMESTAMP) RETURNS VARCHAR(32672) LANGUAGE JAVA PARAMETER STYLE JAVA NO SQL CALLED ON NULL INPUT EXTERNAL NAME 'com.ADInstruments.LTS.InternalDB.dbSync.record.UtilityProcedures.xmlEncode' ; CREATE FUNCTION "SYNC"."RANDOM_UUID" () RETURNS VARCHAR(100) LANGUAGE JAVA PARAMETER STYLE JAVA NO SQL RETURNS NULL ON NULL INPUT EXTERNAL NAME 'com.ADInstruments.LTS.InternalDB.dbSync.record.UtilityProcedures.randomUUID' ; – ---------------------------------------------- – DDL Statements for tables – ---------------------------------------------- CREATE TABLE "APP"."ADMIN_LIST" ("ADMIN_ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), "USER_CODE" VARCHAR(255) NOT NULL); CREATE TABLE "APP"."EXP_RUNS" ("RUN_ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), "MARKER_USERCODE" VARCHAR(255)); – ---------------------------------------------- – DDL Statements for keys – ---------------------------------------------- – primary/unique ALTER TABLE "APP"."EXP_RUNS" ADD CONSTRAINT "RUN_PK" PRIMARY KEY ("RUN_ID"); ALTER TABLE "APP"."ADMIN_LIST" ADD CONSTRAINT "ADMIN_LIST_USER_CODE_UC" UNIQUE ("USER_CODE"); ALTER TABLE "APP"."ADMIN_LIST" ADD CONSTRAINT "ADMIN_PK" PRIMARY KEY ("ADMIN_ID"); – ---------------------------------------------- – DDL Statements for triggers – ---------------------------------------------- CREATE TRIGGER "APP"."ADMIN_LIST_UPDATE_MARKERS" AFTER UPDATE ON "APP"."ADMIN_LIST" REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW UPDATE EXP_RUNS SET MARKER_USERCODE = LOWER(NEW.USER_CODE) WHERE MARKER_USERCODE = LOWER(OLD.USER_CODE);
        Hide
        Mamta A. Satoor added a comment -

        From the above output from dblook, I took out the trigger related stuff as follows to see if I could reproduce the problem and I couldn't. Following is what I tried to repro the bug. I created a db in 10.5 codeline and took the db to 10.7.1.1 codeline and did upgrade on it and it didn't fail. I do not have any data in the tables. I will try to insert some data and make the trigger fire and see if that makes the problem show up

        java -Dij.exceptionTrace=true org.apache.derby.tools.ij
        connect 'jdbc:derby:DB105;create=true';
        CREATE TABLE "APP"."ADMIN_LIST" ("ADMIN_ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
        "USER_CODE" VARCHAR(255) NOT NULL);

        CREATE TABLE "APP"."EXP_RUNS" ("RUN_ID" INTEGER NOT NULL GENERATED BY DEFAULT AS
        IDENTITY (START WITH 1, INCREMENT BY 1), "MARKER_USERCODE" VARCHAR(255));

        – ----------------------------------------------
        – DDL Statements for keys
        – ----------------------------------------------

        – primary/unique
        ALTER TABLE "APP"."EXP_RUNS" ADD CONSTRAINT "RUN_PK" PRIMARY KEY ("RUN_ID");

        ALTER TABLE "APP"."ADMIN_LIST" ADD CONSTRAINT "ADMIN_LIST_USER_CODE_UC" UNIQUE ("USER_CODE");

        ALTER TABLE "APP"."ADMIN_LIST" ADD CONSTRAINT "ADMIN_PK" PRIMARY KEY ("ADMIN_ID");

        – ----------------------------------------------
        – DDL Statements for triggers
        – ----------------------------------------------

        CREATE TRIGGER "APP"."ADMIN_LIST_UPDATE_MARKERS" AFTER UPDATE ON "APP"."ADMIN_LIST"
        REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW
        UPDATE EXP_RUNS SET MARKER_USERCODE = LOWER(NEW.USER_CODE)
        WHERE MARKER_USERCODE = LOWER(OLD.USER_CODE);

        Show
        Mamta A. Satoor added a comment - From the above output from dblook, I took out the trigger related stuff as follows to see if I could reproduce the problem and I couldn't. Following is what I tried to repro the bug. I created a db in 10.5 codeline and took the db to 10.7.1.1 codeline and did upgrade on it and it didn't fail. I do not have any data in the tables. I will try to insert some data and make the trigger fire and see if that makes the problem show up java -Dij.exceptionTrace=true org.apache.derby.tools.ij connect 'jdbc:derby:DB105;create=true'; CREATE TABLE "APP"."ADMIN_LIST" ("ADMIN_ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), "USER_CODE" VARCHAR(255) NOT NULL); CREATE TABLE "APP"."EXP_RUNS" ("RUN_ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), "MARKER_USERCODE" VARCHAR(255)); – ---------------------------------------------- – DDL Statements for keys – ---------------------------------------------- – primary/unique ALTER TABLE "APP"."EXP_RUNS" ADD CONSTRAINT "RUN_PK" PRIMARY KEY ("RUN_ID"); ALTER TABLE "APP"."ADMIN_LIST" ADD CONSTRAINT "ADMIN_LIST_USER_CODE_UC" UNIQUE ("USER_CODE"); ALTER TABLE "APP"."ADMIN_LIST" ADD CONSTRAINT "ADMIN_PK" PRIMARY KEY ("ADMIN_ID"); – ---------------------------------------------- – DDL Statements for triggers – ---------------------------------------------- CREATE TRIGGER "APP"."ADMIN_LIST_UPDATE_MARKERS" AFTER UPDATE ON "APP"."ADMIN_LIST" REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW UPDATE EXP_RUNS SET MARKER_USERCODE = LOWER(NEW.USER_CODE) WHERE MARKER_USERCODE = LOWER(OLD.USER_CODE);
        Hide
        Mike Matrigali added a comment -

        brett, can you comment on the "history" of the database that is having the problem as far as you know. Do you know what
        version derby created it? From the db itself we can only tell what version the database is currently at. So it is possible it
        could have been hard upgraded to the current version it is at. The best chance to get a fix is to somehow reproduce it. more
        info might help.

        Show
        Mike Matrigali added a comment - brett, can you comment on the "history" of the database that is having the problem as far as you know. Do you know what version derby created it? From the db itself we can only tell what version the database is currently at. So it is possible it could have been hard upgraded to the current version it is at. The best chance to get a fix is to somehow reproduce it. more info might help.
        Hide
        Mamta A. Satoor added a comment -

        DERBY-1482 added code to have extra information about triggers collected and saved persistently. These changes went in 10.7 codeline. In DERBY-1482, there was a lot of discussion about how this should be handled to provide upgradability from releases prior to 10.7 to 10.7 and higher releases(The discussion about serialization can be found at DERBY-1482 with the comments starting at date 02/Apr/10 through 28/May/10.). Despite what was agreed on for serialization of the new information, I see that with revision 956763, I have (accidentally) added incorrect serialization code rather than what was discussed and agreed on in the jira. I am pretty certain that is the cause of the problem. I will look into developing a small test case to demonstrate the problem. I think the fix to this would be to change the serialization code to what was agreed upon in DERBY-1482. At this point, I would like to first work on a simple test case which shows the problem and then try the new serialization code to see if that fixes the problem.

        Show
        Mamta A. Satoor added a comment - DERBY-1482 added code to have extra information about triggers collected and saved persistently. These changes went in 10.7 codeline. In DERBY-1482 , there was a lot of discussion about how this should be handled to provide upgradability from releases prior to 10.7 to 10.7 and higher releases(The discussion about serialization can be found at DERBY-1482 with the comments starting at date 02/Apr/10 through 28/May/10.). Despite what was agreed on for serialization of the new information, I see that with revision 956763, I have (accidentally) added incorrect serialization code rather than what was discussed and agreed on in the jira. I am pretty certain that is the cause of the problem. I will look into developing a small test case to demonstrate the problem. I think the fix to this would be to change the serialization code to what was agreed upon in DERBY-1482 . At this point, I would like to first work on a simple test case which shows the problem and then try the new serialization code to see if that fixes the problem.
        Hide
        Mamta A. Satoor added a comment -

        Brett, I will work on a repro on my own but it will be great help if you happen to have a simple repro script for your db showing the problem. Thanks

        Show
        Mamta A. Satoor added a comment - Brett, I will work on a repro on my own but it will be great help if you happen to have a simple repro script for your db showing the problem. Thanks
        Hide
        Mike Matrigali added a comment -

        I still think there may be an architectural problem. I believe we are counting on upgrade getting rid of invalid SPS's during the code that is
        executing on the stack of this issue. But it seems that in order to do it, it is reading all the SPS's from disk and possibly using bad read/write
        code to do so. At least that is what it looks like for the stacks shown, have not debugged this.

        Show
        Mike Matrigali added a comment - I still think there may be an architectural problem. I believe we are counting on upgrade getting rid of invalid SPS's during the code that is executing on the stack of this issue. But it seems that in order to do it, it is reading all the SPS's from disk and possibly using bad read/write code to do so. At least that is what it looks like for the stacks shown, have not debugged this.
        Hide
        Brett Mason added a comment -

        Good news, I can reproduce the problem fairly easily from a clean install of our application. I have done a run through with "derby.language.logStatementText" turned on so I should be able to supply an ij script to reproduce the problem. Will just take a while to work through the 2.5mb of logs .

        Mike, the attached DB has only ever been used with 10.5.1.1.

        Show
        Brett Mason added a comment - Good news, I can reproduce the problem fairly easily from a clean install of our application. I have done a run through with "derby.language.logStatementText" turned on so I should be able to supply an ij script to reproduce the problem. Will just take a while to work through the 2.5mb of logs . Mike, the attached DB has only ever been used with 10.5.1.1.
        Hide
        Mamta A. Satoor added a comment -

        I took Brett's db and tried upgrading it with 10.7 latest codeline and I see the problem there too. Brett's db also failed when I upgraded it to 10.8.1.2

        In short, following is where the attached db upgrades without problem
        trunk
        10.8 codeline

        The upgrade failled with following
        10.7.1.1
        10.8.1.2
        10.7 codeline

        Show
        Mamta A. Satoor added a comment - I took Brett's db and tried upgrading it with 10.7 latest codeline and I see the problem there too. Brett's db also failed when I upgraded it to 10.8.1.2 In short, following is where the attached db upgrades without problem trunk 10.8 codeline The upgrade failled with following 10.7.1.1 10.8.1.2 10.7 codeline
        Hide
        Mike Matrigali added a comment -

        I don't think the problem is in the trigger synchonization code that was discussed as part of DERBY-1482. That discussion was about
        handling upgrade to the SYSTRIGGERS system table, and that code looked right to me. It is located in ReferencedColumnsDescriptorImpl .

        The overall architecture for handling upgrade problems in SYSSTATEMENTS stored query plans, is that basically we don't do any upgrade handling.
        Coders are free to change all the read and write routines of stuff that goes into a stored query plan and need not write upgrade dependent code. What
        is supposed to happen is that if you do this you make sure the branch gets a version number bump, and then the upgrade code is supposed to
        recognize the version number bump and invalidate all those stored dynamic query plans. It looks to me like there is a problem in this area where
        in order to do this upgrade work we are actually reading in the "BAD" plans using code that is not ready to do it. In the current case it looks like
        we are reading in all SPS's to find the database metadata rows because we don't have a good index. This code should not be reading the SPS portion
        of the row as it is not guaranteed to work.

        I think best way to understand this bug:
        1) get a repro that we can run through the full upgrade suite.
        2) figure out what change has happened to fix this and see if we can backport that to 10.7. I looked around at the first level of upgrade code and
        nothing jumped out at me in DD_VERSION.java between 10.7 and trunk.

        Show
        Mike Matrigali added a comment - I don't think the problem is in the trigger synchonization code that was discussed as part of DERBY-1482 . That discussion was about handling upgrade to the SYSTRIGGERS system table, and that code looked right to me. It is located in ReferencedColumnsDescriptorImpl . The overall architecture for handling upgrade problems in SYSSTATEMENTS stored query plans, is that basically we don't do any upgrade handling. Coders are free to change all the read and write routines of stuff that goes into a stored query plan and need not write upgrade dependent code. What is supposed to happen is that if you do this you make sure the branch gets a version number bump, and then the upgrade code is supposed to recognize the version number bump and invalidate all those stored dynamic query plans. It looks to me like there is a problem in this area where in order to do this upgrade work we are actually reading in the "BAD" plans using code that is not ready to do it. In the current case it looks like we are reading in all SPS's to find the database metadata rows because we don't have a good index. This code should not be reading the SPS portion of the row as it is not guaranteed to work. I think best way to understand this bug: 1) get a repro that we can run through the full upgrade suite. 2) figure out what change has happened to fix this and see if we can backport that to 10.7. I looked around at the first level of upgrade code and nothing jumped out at me in DD_VERSION.java between 10.7 and trunk.
        Hide
        Mike Matrigali added a comment -

        I looked through the changes to the 10.8 branch and nothing looked like it would fix this from the description. Seems like next step is to binary search 10.8 with builds to figure out what change fixed this. There are not that many changes, only 28. The release svn number of the 10.8 release is 1095077.

        Show
        Mike Matrigali added a comment - I looked through the changes to the 10.8 branch and nothing looked like it would fix this from the description. Seems like next step is to binary search 10.8 with builds to figure out what change fixed this. There are not that many changes, only 28. The release svn number of the 10.8 release is 1095077.
        Hide
        Mike Matrigali added a comment -

        I looked closer after mamta posted the results for 10.8. I think the fix to DERBY-3870 may have fixed this issue. Maybe knut can say whether it is appropriate to backport that whole change to 10.7 or not. But my guess is that we only need the following change in 10.7 (and probably should
        backport it as far as possible as I think it could fix other issues for upgrade), should verify this one change fixes the problem in 10.7:

        In DataDictionaryImpl.java knut made the change I was saying was a problem with the architecture. You should not be deserializing the
        SPS's during upgrade's attempt to drop/invalidate them:
        public List getAllSPSDescriptors()
        throws StandardException
        {
        TabInfoImpl ti = getNonCoreTI(SYSSTATEMENTS_CATALOG_NUM)
        ;

        List list = newSList();

        // DERBY-3870: The compiled plan may not be possible to deserialize
        // during upgrade. Skip the column that contains the compiled plan to
        // prevent deserialization errors when reading the rows. We don't care
        // about the value in that column, since this method is only called
        // when we want to drop or invalidate rows in SYSSTATEMENTS.
        FormatableBitSet cols = new FormatableBitSet(
        ti.getCatalogRowFactory().getHeapColumnCount());
        for (int i = 0; i < cols.size(); i++) {
        if (i + 1 == SYSSTATEMENTSRowFactory.SYSSTATEMENTS_CONSTANTSTATE)

        { cols.clear(i); }

        else

        { cols.set(i); }

        }

        getDescriptorViaHeap(
        cols,
        (ScanQualifier[][]) null,
        ti,
        (TupleDescriptor) null,
        list);

        return list;

        }

        Show
        Mike Matrigali added a comment - I looked closer after mamta posted the results for 10.8. I think the fix to DERBY-3870 may have fixed this issue. Maybe knut can say whether it is appropriate to backport that whole change to 10.7 or not. But my guess is that we only need the following change in 10.7 (and probably should backport it as far as possible as I think it could fix other issues for upgrade), should verify this one change fixes the problem in 10.7: In DataDictionaryImpl.java knut made the change I was saying was a problem with the architecture. You should not be deserializing the SPS's during upgrade's attempt to drop/invalidate them: public List getAllSPSDescriptors() throws StandardException { TabInfoImpl ti = getNonCoreTI(SYSSTATEMENTS_CATALOG_NUM) ; List list = newSList(); // DERBY-3870 : The compiled plan may not be possible to deserialize // during upgrade. Skip the column that contains the compiled plan to // prevent deserialization errors when reading the rows. We don't care // about the value in that column, since this method is only called // when we want to drop or invalidate rows in SYSSTATEMENTS. FormatableBitSet cols = new FormatableBitSet( ti.getCatalogRowFactory().getHeapColumnCount()); for (int i = 0; i < cols.size(); i++) { if (i + 1 == SYSSTATEMENTSRowFactory.SYSSTATEMENTS_CONSTANTSTATE) { cols.clear(i); } else { cols.set(i); } } getDescriptorViaHeap( cols, (ScanQualifier[][]) null, ti, (TupleDescriptor) null, list); return list; }
        Hide
        Mamta A. Satoor added a comment -

        I made the code change suggested by Mike(along with that, had to make couple other minor changes since the signature of getDescriptorViaHeap has been changed by the code) and the upgrade works fine. I am running the existing upgrade suite to see how it runs. Once it's done, I will fire the regular junit and derbyall tests. Like Mike said, it will be great to have a repro for this problem which we can add to our upgrade suite which will ensure that this test works fine with various upgrades.Also, it seems like it will be good to backport this to older releases as well. Thanks

        Show
        Mamta A. Satoor added a comment - I made the code change suggested by Mike(along with that, had to make couple other minor changes since the signature of getDescriptorViaHeap has been changed by the code) and the upgrade works fine. I am running the existing upgrade suite to see how it runs. Once it's done, I will fire the regular junit and derbyall tests. Like Mike said, it will be great to have a repro for this problem which we can add to our upgrade suite which will ensure that this test works fine with various upgrades.Also, it seems like it will be good to backport this to older releases as well. Thanks
        Hide
        Knut Anders Hatlen added a comment -

        Yes, this sounds similar to the upgrade problem we came across in DERBY-3870. I think it's safe to backport the whole fix to 10.7, as long as we remember to bump the version number on the branch. If the whole fix cannot be backported, the DataDictionaryImpl changes should be sufficient for this issue.

        Show
        Knut Anders Hatlen added a comment - Yes, this sounds similar to the upgrade problem we came across in DERBY-3870 . I think it's safe to backport the whole fix to 10.7, as long as we remember to bump the version number on the branch. If the whole fix cannot be backported, the DataDictionaryImpl changes should be sufficient for this issue.
        Hide
        Mamta A. Satoor added a comment -

        I did the partial backport of Knut's changes to my 10,7 codeline and with that backport, the full upgrade, junit suite and derbyall suite ran fine. I will attach this partial backport to jira. We do not have a standalone test case yet which we can be added to upgrade suite to test the problem as part of our regression suites.

        Show
        Mamta A. Satoor added a comment - I did the partial backport of Knut's changes to my 10,7 codeline and with that backport, the full upgrade, junit suite and derbyall suite ran fine. I will attach this partial backport to jira. We do not have a standalone test case yet which we can be added to upgrade suite to test the problem as part of our regression suites.
        Hide
        Brett Mason added a comment -

        Took a while but I've managed to isolate a test case which can be added to the test suite. Appears to come down to triggers which fire other triggers.

        Steps to reproduce:
        1) Run the attached repro.sql in ij using Derby 10.5.1.1 or 10.6.2.1. It will create a database called "test" in the current directory.
        2) Attempt to open the resulting database in Derby 10.7.1.1 or 10.8.1.2. With or without "upgrade=true".
        3) The error posted above is thrown.

        The script is fairly short so I'll paste it here too:

        CONNECT 'jdbc:derby:test;create=true';

        CREATE TABLE TABLE1 (COL1 VARCHAR(5));
        CREATE TABLE TABLE2 (COL2 VARCHAR(5));
        CREATE TABLE TABLE3 (COL3 VARCHAR(5));

        CREATE TRIGGER TABLE1_UPDATED AFTER UPDATE ON TABLE1 REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW UPDATE TABLE2 SET COL2 = NEW.COL1 WHERE COL2 = OLD.COL1;

        CREATE TRIGGER TABLE2_UPDATED AFTER UPDATE ON TABLE2 REFERENCING NEW AS NEW FOR EACH ROW INSERT INTO TABLE3(COL3) VALUES('ccc');

        insert into TABLE1(COL1) values ('aaa');
        UPDATE TABLE1 SET COL1 = 'bbb';

        Show
        Brett Mason added a comment - Took a while but I've managed to isolate a test case which can be added to the test suite. Appears to come down to triggers which fire other triggers. Steps to reproduce: 1) Run the attached repro.sql in ij using Derby 10.5.1.1 or 10.6.2.1. It will create a database called "test" in the current directory. 2) Attempt to open the resulting database in Derby 10.7.1.1 or 10.8.1.2. With or without "upgrade=true". 3) The error posted above is thrown. The script is fairly short so I'll paste it here too: CONNECT 'jdbc:derby:test;create=true'; CREATE TABLE TABLE1 (COL1 VARCHAR(5)); CREATE TABLE TABLE2 (COL2 VARCHAR(5)); CREATE TABLE TABLE3 (COL3 VARCHAR(5)); CREATE TRIGGER TABLE1_UPDATED AFTER UPDATE ON TABLE1 REFERENCING OLD AS OLD NEW AS NEW FOR EACH ROW UPDATE TABLE2 SET COL2 = NEW.COL1 WHERE COL2 = OLD.COL1; CREATE TRIGGER TABLE2_UPDATED AFTER UPDATE ON TABLE2 REFERENCING NEW AS NEW FOR EACH ROW INSERT INTO TABLE3(COL3) VALUES('ccc'); insert into TABLE1(COL1) values ('aaa'); UPDATE TABLE1 SET COL1 = 'bbb';
        Hide
        Kathey Marsden added a comment -

        Thank you very much Brett for the reproduction! I verified it in my environment. I will pick up this issue, add the upgrade test and look at back porting all or part of DERBY-3870 to the older branches where it may be an issue for other users. Note: If you build the head of the 10.8 branch it already has the fix because DERBY-3870 is already fixed in that branch.

        Show
        Kathey Marsden added a comment - Thank you very much Brett for the reproduction! I verified it in my environment. I will pick up this issue, add the upgrade test and look at back porting all or part of DERBY-3870 to the older branches where it may be an issue for other users. Note: If you build the head of the 10.8 branch it already has the fix because DERBY-3870 is already fixed in that branch.
        Hide
        Kathey Marsden added a comment -

        Attached is a new test case for this issue. I will go ahead and put it in trunk as the issue is fixed with DERBY-3870. One complication with the test was that it cannot run any phase if the old version is affected by DERBY-4385, because the database won't boot when booting in the post soft upgrade phase and other fixtures are affected.

        For the older branches I think I will not backport all of DERBY-3870, but just the relevant part based on the patch mamta provided for this.

        Show
        Kathey Marsden added a comment - Attached is a new test case for this issue. I will go ahead and put it in trunk as the issue is fixed with DERBY-3870 . One complication with the test was that it cannot run any phase if the old version is affected by DERBY-4385 , because the database won't boot when booting in the post soft upgrade phase and other fixtures are affected. For the older branches I think I will not backport all of DERBY-3870 , but just the relevant part based on the patch mamta provided for this.
        Hide
        Kathey Marsden added a comment -

        Here is a full patch for 10.7 with tests. It combines Mamta's subset patch of DERBY-3870, the test for DERBY-5289 and also needed to include the test fix for DERBY-5105. Running tests now.

        Show
        Kathey Marsden added a comment - Here is a full patch for 10.7 with tests. It combines Mamta's subset patch of DERBY-3870 , the test for DERBY-5289 and also needed to include the test fix for DERBY-5105 . Running tests now.
        Hide
        Mike Matrigali added a comment -

        I believe there should be a version bump to whatever version this fix is backported to.

        Show
        Mike Matrigali added a comment - I believe there should be a version bump to whatever version this fix is backported to.
        Hide
        Kathey Marsden added a comment -

        I am not sure that is required for just this subset of DERBY-3870 as it doesn't actually change the compiled plans. The change to DataDictionaryImpl.getAllSPSDescriptiors() is described with this comment:
        + // DERBY-5289 uses partial fix from
        + // DERBY-3870: The compiled plan may not be possible to deserialize
        + // during upgrade. Skip the column that contains the compiled plan to
        + // prevent deserialization errors when reading the rows. We don't care
        + // about the value in that column, since this method is only called
        + // when we want to drop or invalidate rows in SYSSTATEMENTS.

        So, it is just skipping the compiled plan column in a situation where it is already in upgrade.
        As I understand it, if I backported the full DERBY-3870 it would contain some actual generated code change that would require a version bump, but this part just affects what happens when we have a version change already,
        Please let me know if I read this incorrectly.

        Show
        Kathey Marsden added a comment - I am not sure that is required for just this subset of DERBY-3870 as it doesn't actually change the compiled plans. The change to DataDictionaryImpl.getAllSPSDescriptiors() is described with this comment: + // DERBY-5289 uses partial fix from + // DERBY-3870 : The compiled plan may not be possible to deserialize + // during upgrade. Skip the column that contains the compiled plan to + // prevent deserialization errors when reading the rows. We don't care + // about the value in that column, since this method is only called + // when we want to drop or invalidate rows in SYSSTATEMENTS. So, it is just skipping the compiled plan column in a situation where it is already in upgrade. As I understand it, if I backported the full DERBY-3870 it would contain some actual generated code change that would require a version bump, but this part just affects what happens when we have a version change already, Please let me know if I read this incorrectly.
        Hide
        Knut Anders Hatlen added a comment -

        I think your understanding is correct. The backported subset of DERBY-3870 doesn't change the compiled plans, so a version bump shouldn't be required. If an upgrade fails because the fix is missing, booting again with the fix should make the upgrade code run again even if the version number hasn't changed.

        Show
        Knut Anders Hatlen added a comment - I think your understanding is correct. The backported subset of DERBY-3870 doesn't change the compiled plans, so a version bump shouldn't be required. If an upgrade fails because the fix is missing, booting again with the fix should make the upgrade code run again even if the version number hasn't changed.
        Hide
        Kathey Marsden added a comment -

        Resolving this issue. Backported the code fix all the way to 10.1 branch. Even though just recently exposed with the upgrade from 10.5 to 10.8 the code attempting to read in the stored plans on upgrade has always been there.

        Show
        Kathey Marsden added a comment - Resolving this issue. Backported the code fix all the way to 10.1 branch. Even though just recently exposed with the upgrade from 10.5 to 10.8 the code attempting to read in the stored plans on upgrade has always been there.
        Hide
        Knut Anders Hatlen added a comment -

        [bulk update] Close all resolved issues that haven't been updated for more than one year.

        Show
        Knut Anders Hatlen added a comment - [bulk update] Close all resolved issues that haven't been updated for more than one year.

          People

          • Assignee:
            Kathey Marsden
            Reporter:
            Brett Mason
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development