org.h2.jdbc.JdbcSQLException: Table SYSTEM_SEQUENCES not found; SQL statement

5,022 views
Skip to first unread message

Varun

unread,
Jun 25, 2009, 10:20:08 AM6/25/09
to H2 Database
Hi,

I am getting folowing exception using H2 with Hibernate3.3. I would
appreciate if someone help on this issue.


org.h2.jdbc.JdbcSQLException: Table SYSTEM_SEQUENCES not found; SQL
statement:
select sequence_name from information_schema.system_sequences
[42102-114]
at org.h2.message.Message.getSQLException(Message.java:105)
at org.h2.message.Message.getSQLException(Message.java:116)
at org.h2.message.Message.getSQLException(Message.java:75)
at org.h2.schema.Schema.getTableOrView(Schema.java:383)
at org.h2.command.Parser.readTableOrView(Parser.java:4244)
at org.h2.command.Parser.readTableFilter(Parser.java:970)
at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:1500)
at org.h2.command.Parser.parseSelectSimple(Parser.java:1597)
at org.h2.command.Parser.parseSelectSub(Parser.java:1494)
at org.h2.command.Parser.parseSelectUnion(Parser.java:1339)
at org.h2.command.Parser.parseSelect(Parser.java:1327)
at org.h2.command.Parser.parsePrepared(Parser.java:394)
at org.h2.command.Parser.parse(Parser.java:290)
at org.h2.command.Parser.parse(Parser.java:262)
at org.h2.command.Parser.prepareCommand(Parser.java:234)
at org.h2.engine.Session.prepareLocal(Session.java:409)
at org.h2.engine.Session.prepareCommand(Session.java:370)
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:
1044)
at org.h2.jdbc.JdbcStatement.executeQuery(JdbcStatement.java:68)
at org.hibernate.tool.hbm2ddl.DatabaseMetadata.initSequences
(DatabaseMetadata.java:151)
at org.hibernate.tool.hbm2ddl.DatabaseMetadata.<init>
(DatabaseMetadata.java:69)
at org.hibernate.tool.hbm2ddl.SchemaValidator.validate
(SchemaValidator.java:132)
at org.hibernate.impl.SessionFactoryImpl.<init>
(SessionFactoryImpl.java:349)
at org.hibernate.cfg.Configuration.buildSessionFactory
(Configuration.java:1327)
at com.test.HibernateUtil.<clinit>(HibernateUtil.java:14)
at com.test.EventManager.listEvents(EventManager.java:29)
at com.test.EventManager.main(EventManager.java:15)

Thanks in advance,
Varun

Manish Agarwal

unread,
Jun 26, 2009, 8:31:36 AM6/26/09
to h2-da...@googlegroups.com
it seems you tried to port the h2database or your are trying to use some constraint in tables which is generating the null value. because of that it's giving you the exception

Thomas Mueller

unread,
Jun 28, 2009, 2:44:04 AM6/28/09
to h2-da...@googlegroups.com
Hi,

It looks like you are using the HSQLDB dialect with H2, and this
dialect tries to query the table SYSTEM_SEQUENCES. Most of the time,
the HSQLDB dialect works fine with H2, but it seems in this case you
need to use the H2 dialect (or another one, for example the PostgreSQL
dialect).

The latest H2 dialect for Hibernate is included in the H2 source code,
but the class is renamed to .java.txt - see
src/tools/org/hibernate/dialect/H2Dialect.java.txt. The H2 dialect
that comes with Hibernate contains a bug (it only affects you when
using BOOLEAN columns).

Regards,
Thomas

Lico

unread,
Jul 9, 2009, 5:30:37 PM7/9/09
to H2 Database
Thanks a million Thomas! I have changed to H2Dialect and working
perfectly now.
Reply all
Reply to author
Forward
0 new messages