I may have a solution for you - making a few assumptions.
Bottom line on top: if you're using file:/ HSQL URLs, try changing the SET WRITE_DELAY 10 line in the .script to SET WRITE_DELAY 0.
Full details for the curious:
I think there's a problem with Hibernate using HSQL 1.8 drivers and file:/ URLS.
Test procedure:
1) Download new HSQL drivers - 1.8.0 or later (mine are 1.8).
2) Download hibernate-3.2.3-ga and unzip.
3) Make 1 change to the /doc/tutorial/src/hibernate.cfg.xml file - change
jdbc:hsqldb:hsql://localhost
to
jdbc:hsqldb:file:/db/dbtest
4) make a /db directory.
5) Add the appropriate jars
6) Run ant run -Daction="store"
Everything appears to go OK - no errors:
Code:
[java] 00:01:36,312 DEBUG SchemaExport:303 - create table EVENTS (EVENT_ID bigint generated by default as identity (start with 1), EVENT_DATE timestamp, title varchar(255), primary key (EVENT_ID))
[java] 00:01:36,328 DEBUG SchemaExport:303 - create table PERSON (PERSON_ID bigint generated by default as identity (start with 1), age integer, firstname varchar(255), lastname varchar(255), primary key (PERSON_ID))
[java] 00:01:36,328 DEBUG SchemaExport:303 - create table PERSON_EMAIL_ADDR (PERSON_ID bigint not null, EMAIL_ADDR varchar(255))
[java] 00:01:36,328 DEBUG SchemaExport:303 - create table PERSON_EVENT (EVENT_ID bigint not null, PERSON_ID bigint not null, primary key (PERSON_ID, EVENT_ID))
[java] 00:01:36,328 DEBUG SchemaExport:303 - alter table PERSON_EMAIL_ADDR add constraint FKA54215FE7708282F foreign key (PERSON_ID) references PERSON
[java] 00:01:36,328 DEBUG SchemaExport:303 - alter table PERSON_EVENT add constraint FKAD91D9107708282F foreign key (PERSON_ID) references PERSON
[java] 00:01:36,328 DEBUG SchemaExport:303 - alter table PERSON_EVENT add constraint FKAD91D910F96D1A45 foreign key (EVENT_ID) references EVENTS
[java] 00:01:36,328 INFO SchemaExport:196 - schema export complete
[java] Hibernate: insert into EVENTS (EVENT_ID, EVENT_DATE, title) values (null, ?, ?)
[java] Hibernate: call identity()
[java] 00:01:36,484 INFO SessionFactoryImpl:769 - closing
[java] 00:01:36,484 INFO DriverManagerConnectionProvider:147 - cleaning up connection pool: jdbc:hsqldb:file:/db/dbtest
The standard HSQL files are created in /db/dbtest - lck, log, properties, and script. However, they are all basically empty - no matter how many times I run it, and whether or not the ddl export is enabled. After a few runs, the contents of .script is:
Code:
CREATE SCHEMA PUBLIC AUTHORIZATION DBA
CREATE USER SA PASSWORD ""
GRANT DBA TO SA
SET WRITE_DELAY 10
and it never goes beyond that.
So finally, after checking EVERYTHING twice or three times, I changed the SET WRITE_DELAY line to 0. Hand-hacking the .script isn't recommended, but it sure is useful sometimes =) In this case, VERY useful. After doing that, all of the DDL and INSERTS actually work! I need to read up on the overall effect of this on HSQL ... may not be something you want to do for production.