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.
This archive was generated by hypermail 2.0.0 : Fri Jun 29 2007 - 06:58:51 EDT