db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon James <sja...@btisystems.com>
Subject Multiple Schemas with Derby, Hibernate & JPA
Date Mon, 20 Sep 2010 07:48:18 GMT

I have a problem using multiple schemas with Derby, Hibernate & JPA.
Although I don't have the problem when using MySql, the database/schema models of Derby and
MySql are different and so
I realise this might be a problem with Hibernate rather than Derby.

I have 2 schemas (S1 & S2) each of which contains a table of the same name (MyTable) which
is created from the same Java entity.

When I create the EntityManagerFactory with the url for S1 (for example: jdbc:derby:dbname;create=true;user=S1),
MyTable is created in schema S1.
When I create the EntityManagerFactory with the url for S2, Hibernate logs a message indicating
that MyTable already exists and so does not create it.
However, if I subsequently use an EntityManager created by the factory for S2, inserts fail
because MyTable does not exist.

Has anybody else experienced this problem?

Regards

Simon

Mime
View raw message