Uploaded image for project: 'Cayenne'
  1. Cayenne
  2. CAY-817

HSQLDB schema generation may not correctly flush the changes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.2 branch, 2.0 branch, 3.0
    • 3.0M1
    • Core Library, Modeler
    • None

    Description

      When investigating CAY-790, I noticed that our own code is prone to HSQLDB problem with not flushing changes to disk immediately. When the Modeler (or I believe the Ant task) generates schema, nothing may get generated. I tried adding the following code to the Modeler and it seems to solve to problem (only instead of "SHUTDOWN" it issues "CHECKPOINT"):

      if (connectionInfo.getUrl().startsWith("jdbc:hsqldb:file:")) {
      Connection c = dataSource.getConnection();
      try {
      PreparedStatement st = c.prepareStatement("CHECKPOINT");
      try

      { st.execute(); }

      finally

      { st.close(); }

      }
      finally

      { c.close(); }

      }

      Since DbAdapter does not provides API for "post-generation processing" of the DB, I guess I'll add db-specific handlers straight into the DbGenerator, that would detect a DB type using DbAdapterFactory.

      Attachments

        Activity

          People

            andrus Andrus Adamchik
            andrus Andrus Adamchik
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: