You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cayenne.apache.org by "Andrus Adamchik (JIRA)" <de...@cayenne.apache.org> on 2007/06/29 12:58:27 UTC

[JIRA] Created: (CAY-817) HSQLDB schema generation may not correctly flush the changes

HSQLDB schema generation may not correctly flush the changes
------------------------------------------------------------

                 Key: CAY-817
                 URL: https://issues.apache.org/cayenne/browse/CAY-817
             Project: Cayenne
          Issue Type: Bug
          Components: Cayenne Core Library, CayenneModeler GUI
    Affects Versions: 1.2 [STABLE], 2.0 [STABLE], 3.0
            Reporter: Andrus Adamchik
            Assignee: Andrus Adamchik
            Priority: Minor
             Fix For: 3.0


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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.