HSQLDB 2.6.1, Hibernate 5.4.30.Final, DDL statements reapplied at every restart

Andrea Spacca <[email protected]> Sun, 7 Nov 2021 10:03:26 +0100
Newsgroups gmane.comp.java.hsqldb.user
Message-ID <[email protected]>
Hello,

I'm trying to setup the application at 
https://github.com/TeamPiped/Piped-Backend to use an HSQLDB file db.

I have the following settins:
# Hibernate properties
hibernate.connection.url: 
jdbc:hsqldb:file:hsqldb/piped;sql.syntax_pgs=true;sql.lowercase_ident=true;sql.enforce_tdc_delete=false;sql.enforce_tdc_update=false;close_result=true;allow_empty_batch=true;shutdown=true;sql.sys_index_names=false;hsqldb.applog=3;hsqldb.sqllog=3;hsqldb.write_delay=false
hibernate.connection.driver_class: org.hsqldb.jdbcDriver
hibernate.dialect: org.hibernate.dialect.HSQLDialect
hibernate.connection.username: username:
hibernate.connection.password: password:
hibernate.hbm2ddl.auto: create
hibernate.temp.use_jdbc_metadata_defaults: false
hibernate.connection.shutdown: true


Everything seems fine but for the fact that at every restart the DDL 
statements from hibernate are run again.

In the SQL logs I can see the following:
2021-11-07 08:42:46.357 2 select * from information_schema.sequences
2021-11-07 08:42:46.377 2 SELECT * FROM INFORMATION_SCHEMA.SYSTEM_TABLES 
WHERE TRUE AND TABLE_SCHEM IS NULL AND TABLE_NAME LIKE '%' AND 
TABLE_TYPE IN ('TABLE','VIEW')
2021-11-07 08:42:46.399 2 SELECT * FROM 
INFORMATION_SCHEMA.SYSTEM_COLUMNS WHERE TRUE AND TABLE_SCHEM IS NULL AND 
COLUMN_NAME LIKE '%'

They are executed at every restart of the application.
My guess is that these statements are run by hibernate in order to 
understand what DDL statements to execute in order to setup the db for 
the defined Entities.

Is it my assumption correct?

Could it be a problem that the table and column names generated from the 
entities are not matching the expected ones in the information schema? 
(different cases, potential appended prefix, whatever...)

Did anyone have a similar issue, and how did you solve it?

Thanks,
Andrea Spacca