Forums Register Login

HSQLDB & Ant - tables not persisting?

+Pie Number of slices to send: Send
I wasn't sure which forum to ask this question in, but this forum seemed to have more references to HSQLDB, so here I am.

I have set included the hsqldb.jar in my lib and I have the following properties:


When I run the ant sql target, it seems to create the database files in the same directory as the build script.
So far, so good. When I run the target, which includes the following sql statements


it fails to execute the DROP TABLE statements. This is expected as the tables do not yet exist.

However, when I run the same target again, I get the same error.

According to the docs, "Memory tables are the default type when the CREATE TABLE command is used. Their data is held entirely in memory but any change to their structure or contents is written to the <dbname>.script file. The script file is read the next time the database is opened, and the MEMORY tables are recreated with all their contents. So ... MEMORY tables are persistent."

I don't understand why the tables don't exist after I've already created them.
+Pie Number of slices to send: Send
Resolved:
When I use COMMIT and SHUTDOWN, the problem is resolved. Ant sets autocommit to false by default. And apparently the memory tables are not persisted until shutdown is executed.
Grow your own food... or this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1172 times.
Similar Threads
insert followed by an update with CompositeUserType
Database Access problem
How database info is specfied in persistence.xml
to run alter command in Access
Hibernate with HSQLdb - SQLException requires collation in statement
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 23:44:37.