I have a persistence.xml including two XA-Open enabled data sources for two different databasese. persistence-unit A has a table let's say tableA, whist persistence-unit B has a table tableB.
I set the hibernate.hbm2ddl.auto=validate for both persistence unit.
The problem is that when starting my application the Hibernate complains that the tableB is missing in persistence-unit A, the tableA is missing in persistence-unit B, as I see, this is really ridiculous and it seems that the hibernate validation process does not distinguish tables under different persistence unit at all.
To prove this, I tried to set hibernate.hbm2ddl.auto=update, then tableB is automatically created under my database A, whilst tableA is created under database B.
I deleted the redundant tables then set ibernate.archive.autodetection=false. Then everything went fine.
So, is this a bug of Hibernate? Any better idea?
|