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

Read-only databases fail to boot after soft upgrade. Raises error message: 40XD1: Container was opened in read-only mode.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 10.1.1.0, 10.1.3.2, 10.2.1.6
    • Fix Version/s: 10.1.3.2, 10.2.1.6
    • Component/s: SQL
    • Labels:
      None
    • Environment:
      All platforms
    • Urgency:
      Low

      Description

      Attempting to boot a database that is created using Derby 10.0 fail in soft upgrade mode in Derby 10.1 or in trunk. (10.2) Boot fails with Error 40XD1: Container was opened in read-only mode.

      After debugging the problem a little, it seems soft upgrade code attempts do change a database property value and since the database is read-only, the error is raised. Here is what I tried:

      ij> connect 'jdbc:derby:jar:(t10.jar)t10db';
      ERROR XJ040: Failed to start database 'jar:(t10.jar)t10db', see the next exception for details.
      ERROR 40XD1: Container was opened in read-only mode.

      Here is the stack trace:

      ERROR 40XD1: Container was opened in read-only mode.
      at org.apache.derby.iapi.error.StandardException.newException(StandardException.java:301)
      at org.apache.derby.impl.store.raw.data.BaseContainer.use(BaseContainer.java:539)
      at org.apache.derby.impl.store.raw.data.BaseContainerHandle.useContainer
      (BaseContainerHandle.java:786)
      at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.openContainer(BaseDataFileFactory.java:633)
      at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.openContainer(BaseDataFileFactory.java:494)
      at org.apache.derby.impl.store.raw.xact.Xact.openContainer(Xact.java:1270)
      at org.apache.derby.impl.store.access.conglomerate.OpenConglomerate.init
      (OpenConglomerate.java:865)
      at org.apache.derby.impl.store.access.heap.Heap.openScan(Heap.java:675)
      at org.apache.derby.impl.store.access.RAMTransaction.openScan(RAMTransaction.java:530)
      at org.apache.derby.impl.store.access.RAMTransaction.openScan(RAMTransaction.java:1582)
      at org.apache.derby.impl.store.access.PropertyConglomerate.openScan(PropertyConglomerate.java:230)
      at org.apache.derby.impl.store.access.PropertyConglomerate.saveProperty(
      PropertyConglomerate.java:296)
      at org.apache.derby.impl.store.access.PropertyConglomerate.setProperty(PropertyConglomerate.java:535)
      at org.apache.derby.impl.store.access.RAMTransaction.setProperty(RAMTransaction.java:1787)
      at org.apache.derby.impl.sql.catalog.DD_Version.applySafeChanges(DD_Version.java:281)
      at org.apache.derby.impl.sql.catalog.DD_Version.upgradeIfNeeded(DD_Version.java:223)
      at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.loadDictionaryTables(DataDictionaryImpl.java:5826)
      at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.boot(DataDictionaryImpl.java:629)
      at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1996)
      at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:290)
      at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(BaseMonitor.java:542)
      at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Monitor.java:418)
      at org.apache.derby.impl.sql.conn.GenericLanguageConnectionFactory.bootDataDictionary(GenericLanguageConnectionFactory.java:355)
      at org.apache.derby.impl.sql.conn.GenericLanguageConnectionFactory.boot(
      GenericLanguageConnectionFactory.java:328)
      at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.j
      ava:1996)
      at org.apache.derby.impl.services.monitor.TopService.bootModule(TopServi
      ce.java:290)
      at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(BaseMo
      nitor.java:542)
      at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Moni
      tor.java:418)
      at org.apache.derby.impl.db.BasicDatabase.boot(BasicDatabase.java:193)
      at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1996)
      at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:290)
      at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(BaseMonitor.java:1834)
      at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(BaseMonitor.java:1700)
      at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService
      BaseMonitor.java:1528)
      at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(BaseMonitor.java:998)
      at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(BaseMonitor.java:990)
      at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService
      (Monitor.java:533)
      at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(EmbedConnection.java:1551)
      at org.apache.derby.impl.jdbc.EmbedConnection.<init>(EmbedConnection.java:196)
      at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(EmbedConnection30.java:72)
      at org.apache.derby.jdbc.Driver30.getNewEmbedConnection(Driver30.java:73)
      at org.apache.derby.jdbc.InternalDriver.connect(InternalDriver.java:183)
      at java.sql.DriverManager.getConnection(DriverManager.java:512)
      at java.sql.DriverManager.getConnection(DriverManager.java:140)
      at org.apache.derby.impl.tools.ij.ij.dynamicConnection(ij.java:836)
      at org.apache.derby.impl.tools.ij.ij.ConnectStatement(ij.java:698)
      at org.apache.derby.impl.tools.ij.ij.ijStatement(ij.java:528)
      at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:289)
      at org.apache.derby.impl.tools.ij.Main.go(Main.java:203)
      at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:169)
      at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:55)
      at org.apache.derby.tools.ij.main(ij.java:60)
      ij>

        Attachments

        1. DERBY-541
          0.8 kB
          Satheesh E. Bandaram

          Issue Links

            Activity

              People

              • Assignee:
                bandaram Satheesh E. Bandaram
                Reporter:
                bandaram Satheesh E. Bandaram
              • Votes:
                1 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: