Tuesday, December 16, 2008

hsqldb doesn't save data (shutdown solution)

== hsqldb doesn't move data from .log to .script

Since HSQLDB > 1.7.1 an explict shutdown command is required in order to keep data persistant. So, if one follows the steps in chapter 1 of hibernates documentation
an uses for example hsqldb-1.8.0.2 (currently the latest release) the newly created Event's will in most cases not stored in the db.

This can be fixed by passing the required hsql driver property shutdown=true within the connection url.

I changed the proposed hibernate.cfg.xml property file to use

<property name="connection.url">jdbc:hsqldb:file:data/tutorial;shutdown=true</property>

rather

<property name="connection.url">jdbc:hsqldb:data/tutorial</property>

and things worked as expected.
http://opensource.atlassian.com/projects/hibernate/browse/HHH-1114

fuck! I've spend hours and hours to find where the problem is and why I am doing everything like in the tutorial, but don't get the same result as I've been promised=)

1 comments:

  1. That won't help if error is occured during transaction
    ReplyDelete