I have two persistence-unit
s, which are identical except other uses Hibernate's hbm2ddl create-drop
and the other uses validate
and there the database is created by liquiBase.
Now running any of the tests (HSQLDB named in-mem db) from eclipse, they work fine. But running all of them from maven, they brake with strange foreign key violations.
What I think is strange is that I get messages from 4 different threads and for example closing one of the Persistence Units happens while table drops are still written to console.
Why do I get four threads, all with their own ApplicationContexts? I have no parallel
parameters set for surefire and I'm not using -T switch for maven either.
Edit:
Here's a snippet from the commandline output of Maven
Hibernate: drop table PostalCodeDistribution if exists
Hibernate: drop table PublicationAudit if exists
15:21:13.672 [Thread-2] INFO org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean - Closing JPA EntityManagerFactory for persistence unit 'TestPU-nocreate'
Hibernate: drop table PostalCodeDistributionAudit if exists
Hibernate: drop table PublicationInvoicing if exists
Hibernate: drop table PostalCodeSubscriberCountAudit if exists
15:21:13.672 [Thread-2] INFO org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl - HHH000030: Cleaning up connection pool [jdbc:hsqldb:mem:ptptest]
Hibernate: drop table Revision if exists
Hibernate: drop table PriceDate if exists