Howdy
I am having an issue with the hbm2ddl.auto=update under hsqldb. I know there is an issue with 1.8 and I have reved back to 1.7.1 but still cant get the update to auto create or modify the ddl.
It was talked about here:
http://forum.hibernate.org/viewtopic.php?t=948369
and I have tried looking it up in jira but have had no success.
It appears that the update is looking for the SYSTEM_SEQUENCES table and failing since that table is a HSQL 1.8 thing. Im wondering if the addition of the SYSTEM_SEQUENCES support to 3.1 broke backwards compatability for HSQL update?
Any help would be apprciated.
Thanks
-=Brian
Hibernate version:
3.1rc1
Mapping documents:
<hibernate-configuration>
<session-factory>
<!-- Database connection settings -->
<property name="connection.driver_class">org.hsqldb.jdbcDriver</property>
<property name="connection.url">jdbc:hsqldb:target/testdb/testdb</property>
<property name="connection.username">sa</property>
<property name="connection.password"></property>
<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">1</property>
<property name="connection.release_mode">after_transaction</property>
<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.HSQLDialect</property>
<!-- Echo all executed SQL to stdout -->
<property name="show_sql">false</property>
<!-- Drop and re-create the database schema on startup -->
<property name="hbm2ddl.auto">update</property>
<mapping class="com.novusedge.access.core.objects.Peer"/>
<mapping class="com.novusedge.access.core.objects.Controller"/>
<!-- mapping resource="AccessObjects.hbm.xml"/-->
</session-factory>
</hibernate-configuration>
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
None except cant find SQL table for insert.
Name and version of the database you are using:
hsqldb 1.7.1
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
INFO - Running hbm2ddl schema update
INFO - fetching database metadata
DEBUG - total checked-out connections: 0
DEBUG - using pooled JDBC connection, pool size: 0
ERROR - could not get database metadata
java.sql.SQLException: Table not found: SYSTEM_SEQUENCES in statement [select sequence_name from system_sequences]
at org.hsqldb.Trace.getError(Unknown Source)
at org.hsqldb.jdbcResultSet.<init>(Unknown Source)
at org.hsqldb.jdbcConnection.executeStandalone(Unknown Source)
at org.hsqldb.jdbcConnection.execute(Unknown Source)
at org.hsqldb.jdbcStatement.fetchResult(Unknown Source)
at org.hsqldb.jdbcStatement.executeQuery(Unknown Source)
at org.hibernate.tool.hbm2ddl.DatabaseMetadata.initSequences(DatabaseMetadata.java:119)
at org.hibernate.tool.hbm2ddl.DatabaseMetadata.<init>(DatabaseMetadata.java:45)
at org.hibernate.tool.hbm2ddl.DatabaseMetadata.<init>(DatabaseMetadata.java:38)
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:133)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:298)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1145)
at com.novusedge.access.core.persistence.HibernateUtil.<clinit>(HibernateUtil.java:33)
at HibernateHacklet.run(HibernateHacklet.java:20)
at HibernateHacklet.main(HibernateHacklet.java:16)
ERROR - could not complete schema update
java.sql.SQLException: Table not found: SYSTEM_SEQUENCES in statement [select sequence_name from system_sequences]
at org.hsqldb.Trace.getError(Unknown Source)
at org.hsqldb.jdbcResultSet.<init>(Unknown Source)
at org.hsqldb.jdbcConnection.executeStandalone(Unknown Source)
at org.hsqldb.jdbcConnection.execute(Unknown Source)
at org.hsqldb.jdbcStatement.fetchResult(Unknown Source)
at org.hsqldb.jdbcStatement.executeQuery(Unknown Source)
at org.hibernate.tool.hbm2ddl.DatabaseMetadata.initSequences(DatabaseMetadata.java:119)
at org.hibernate.tool.hbm2ddl.DatabaseMetadata.<init>(DatabaseMetadata.java:45)
at org.hibernate.tool.hbm2ddl.DatabaseMetadata.<init>(DatabaseMetadata.java:38)
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:133)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:298)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1145)
at com.novusedge.access.core.persistence.HibernateUtil.<clinit>(HibernateUtil.java:33)
at HibernateHacklet.run(HibernateHacklet.java:20)
at HibernateHacklet.main(HibernateHacklet.java:16)
INFO - cleaning up connection pool: jdbc:hsqldb:target/testdb/testdb
INFO - Checking 0 named queries
can dump full debug log if you need it