db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicola DiPasquale <nicholas.dipasqu...@gmail.com>
Subject Embedded Derby w/Hibernate
Date Sun, 24 May 2009 04:07:32 GMT
> Did you create the tables? You have to use regular SQL to actually
> create the tables in the database before you can access them with
> Hibernate.

I want Hibernate to create the tables automatically for me.  I do not
have a SQL schema designed for the data I am trying to store, I have
POJOs with EJB3 persistence annotations.

> Actually you can have Hibernate take care of the DDL via the 'hibernate.hbm2ddl.auto=create-drop'
property.

I already have Hibernate properly configured to use Derby and to
create the tables for me, that is not the issue.  The issue that I am
having is that Derby is throwing an exception after creating the
tables claiming that the tables and views it just created do not
exist.  This only happens the first time that I run the application.
If I restart the application with the same setting, since the DB
already exists I do not have a problem.  It would however be in poor
form to require that I start the application twice every time that I
want to do something with it, so I am looking for a potential
fix/workaround other than restarting the app for this situation.
Thanks.

-Nicola DiPasquale

Mime
View raw message