Hibernate schema updates

168 views
Skip to first unread message

"Paul E. Sevinç"

unread,
May 26, 2010, 5:15:05 PM5/26/10
to h2-da...@googlegroups.com
Hey y'all!

We're currently using h2 1.2.135 and Hibernate 3.3.2.


When our Web application (running in Tomcat) starts up, Hibernate thinks
that the tables don't exist (even though they do), e.g.:
[java] KS 2010-05-26 22:45:35 [main] INFO
o.h.tool.hbm2ddl.SchemaUpdate - Running hbm2ddl schema update
[java] KS 2010-05-26 22:45:35 [main] INFO
o.h.tool.hbm2ddl.SchemaUpdate - fetching database metadata
[java] KS 2010-05-26 22:45:35 [main] INFO
o.h.tool.hbm2ddl.SchemaUpdate - updating schema
[java] KS 2010-05-26 22:45:35 [main] INFO
o.h.tool.hbm2ddl.DatabaseMetadata - table not found: CACHED_CONTACTS


So Hibernate then tries to create the tables, which fails (because they
already exist):
[java] KS 2010-05-26 22:45:35 [main] ERROR
o.h.tool.hbm2ddl.SchemaUpdate - Unsuccessful: create table
CACHED_CONTACTS (CONTACT_ID bigint generated by default as identity,
email varchar(128) not null, externalId varchar(256) not null, title
varchar(64), ADDRESSBOOK_ID bigint, primary key (CONTACT_ID))
[java] KS 2010-05-26 22:45:35 [main] ERROR
o.h.tool.hbm2ddl.SchemaUpdate - Tabelle "CACHED_CONTACTS" besteht bereits
[java] Table "CACHED_CONTACTS" already exists; SQL statement:
[java] create table CACHED_CONTACTS (CONTACT_ID bigint generated
by default as identity, email varchar(128) not null, externalId
varchar(256) not null, title varchar(64), ADDRESSBOOK_ID bigint, primary
key (CONTACT_ID)) [42101-135]


Does anybody have an idea what's going wrong? (The Web application runs
fine, but we'd like to automatically manage schema diffs and therefore
need SchemaUpdate and DatabaseMetadata to work correctly with h2.)


Thanks and best regards,
Paul

Thomas Mueller

unread,
May 28, 2010, 1:14:24 AM5/28/10
to h2-da...@googlegroups.com
Hi,

I'm not sure what the problem might be. What is your database URL and
Hibernate configuration? That's the most important information I need.
Then, could you add ";TRACE_LEVEL_FILE=3" to the database URL and post
(or send me) the .trace.db file(s). There is only one file when using
the embedded mode, but multiple files when using a remote protocol.

Regard,
Thomas

Paul

unread,
May 30, 2010, 7:21:15 AM5/30/10
to H2 Database
Thanks, Thomas, I'm going to send the files to your Gmail account.


Have a nice Sunday afternoon,
Paul
Reply all
Reply to author
Forward
0 new messages