Hi. To simplify testing I'm using the latest version of HSQLDB (1.8.0.9), the db type is file and I'm creating cached tables:
- the jdbc url is: jdbc:hsqldb:file:db/test
- by default, org.hibernate.dialect.HSQLDialect creates in memory tables, so I subclassed it and overrode the getCreateTable() method to return "create cached table" (works fine, since it creates the db/test.data file).
However, when I close the app the db/test.lck file doesn't dissapear, and not does the log file. Also, the data file contains 1 Mb worth of null characters. So I tried changing the url to: jdbc:hsqldb:file:db/test;shutdown=true, and nothing happens. So I changed hibernate.cfg.xml to contain:
<property name="hibernate.connection.shutdown">true</property>
This time, the shutdown property is logged by hibernate (which was NOT the case when used the changed url), but again, this doesn't seem to be working.
When I used:
session.connection().createStatement().execute("SHUTDOWN");
at the end of the app (just before closing the session) it worked fine, the script file was created, the log file dissapeared, and the data file contains actual data.
Could anybody please help me out with this? What am I doing wrong?
Thanks.
|