• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HSQLDB & Ant - tables not persisting?

 
Marilyn de Queiroz
Sheriff
Posts: 9067
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Marilyn de Queiroz
Sheriff
Posts: 9067
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic