Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.2 branch, 2.0 branch, 3.0
-
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
finally
{ st.close(); } }
finally
}
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.