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

Derby cannot replace a database after encountering corruption

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.4.2.0
    • 10.4.2.1, 10.5.1.1
    • Store
    • None
    • High Value Fix
    • Crash

    Description

      When Derby encounters a corrupt data file, it does not close the data file before throwing an exception to the caller. If the user tries to replace the database with a backup in response to the corruption, Derby will first attempt to delete the contents of the corrupt database. But since the corrupt file was never closed, it cannot be deleted, and Derby fails to start.

      The attached java code should reproduce the problem, and the attached patch should fix it.

      Attachments

        1. DERBY-3875_2.diff
          10 kB
          Myrna van Lunteren
        2. DERBY-3875_tst1.diff
          9 kB
          Myrna van Lunteren
        3. derby-3875-BackupRestoreTest.diff
          7 kB
          Kristian Waagan
        4. derby-3875-BackupRestoreTest.stat
          0.2 kB
          Kristian Waagan
        5. FileCloseBugDemo.java
          2 kB
          Jason McLaurin
        6. FileCloseBugDemo.java
          2 kB
          Jason McLaurin
        7. RAFContainerPatch.txt
          0.9 kB
          Jason McLaurin

        Activity

          People

            jmclaurin Jason McLaurin
            jmclaurin Jason McLaurin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 2h
                2h
                Remaining:
                Remaining Estimate - 2h
                2h
                Logged:
                Time Spent - Not Specified
                Not Specified