Re: HSQLDB 2.6.1, Hibernate 5.4.30.Final, DDL statements reapplied at every restart
Fred Toussi via Hsqldb-user <[email protected]> Sun, 07 Nov 2021 09:33:38 +0000
| Newsgroups | gmane.comp.java.hsqldb.user |
|---|---|
| Message-ID | <[email protected]> |
Hibernate is covered extensively at StackOverflow. For example:
https://stackoverflow.com/questions/438146/what-are-the-possible-values-of-the-hibernate-hbm2ddl-auto-configuration-and-wha/1689769#1689769
Regarding your HSQLDB settings, see if you really need sql.lowercase_ident=true. This setting is only necessary if you are using a database access library that assumes (like PostgreSQL) column names in ResultSet are lowercase.
Fred
On Sun, Nov 7, 2021, at 09:03, Andrea Spacca wrote:
> 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
>
>
> _______________________________________________
> Hsqldb-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/hsqldb-user