Hibernate populate database schema multiple times with same DDL in multiple persist
units.
------------------------------------------------------------------------------------------
Key: HHH-6667
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-6667
Project: Hibernate Core
Issue Type: Improvement
Components: core
Affects Versions: 4.0.0.CR3
Reporter: Jeff Yu
I have a multiple persist unit(s) within a JPA project. I've found that by specifying
the 'hibernate.hbm2ddl.auto=create',the same database schema ddl (that is
generated by Hibernate itself, contains all of those persist units annotated entities) has
been populated multiple times. So I think it would be better that we just populate
database schema ddl per a persist unit. I've tried this with the Ejb3Configuration
(programmatically configure the entities) to add those annotated entities, it is working
fine.
Below is some ERROR(s) that I've got inside my project when initialising the
EntityManagerFactory:
INFO - CoreMessageLogger_$logger.transactionStrategy(2248) | HHH00268:Transaction
strategy: org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory
INFO - CoreMessageLogger_$logger.usingAstQueryTranslatorFactory(1878) | HHH00397:Using
ASTQueryTranslatorFactory
INFO - CoreMessageLogger_$logger.runningHbm2ddlSchemaExport(3504) | HHH00227:Running
hbm2ddl schema export
ERROR - CoreMessageLogger_$logger.unsuccessfulCreate(2374) | HHH00389:Unsuccessful: create
table BPEL_ACTIVITY_RECOVERY (ID bigint generated by default as identity, ACTIONS
varchar(255), ACTIVITY_ID bigint, CHANNEL varchar(255), DATE_TIME timestamp, DETAILS clob,
INSTANCE_ID bigint, REASON varchar(255), RETRIES integer, primary key (ID))
ERROR - CoreMessageLogger_$logger.error(3573) | Table "BPEL_ACTIVITY_RECOVERY"
already exists; SQL statement:
create table BPEL_ACTIVITY_RECOVERY (ID bigint generated by default as identity, ACTIONS
varchar(255), ACTIVITY_ID bigint, CHANNEL varchar(255), DATE_TIME timestamp, DETAILS clob,
INSTANCE_ID bigint, REASON varchar(255), RETRIES integer, primary key (ID)) [42101-124]
ERROR - CoreMessageLogger_$logger.unsuccessfulCreate(2374) | HHH00389:Unsuccessful: create
table BPEL_CORRELATION_SET (CORRELATION_SET_ID bigint generated by default as identity,
CORRELATION_KEY varchar(255), NAME varchar(255), SCOPE_ID bigint, primary key
(CORRELATION_SET_ID))
ERROR - CoreMessageLogger_$logger.error(3573) | Table "BPEL_CORRELATION_SET"
already exists; SQL statement:
create table BPEL_CORRELATION_SET (CORRELATION_SET_ID bigint generated by default as
identity, CORRELATION_KEY varchar(255), NAME varchar(255), SCOPE_ID bigint, primary key
(CORRELATION_SET_ID)) [42101-124]
ERROR - CoreMessageLogger_$logger.unsuccessfulCreate(2374) | HHH00389:Unsuccessful: create
table BPEL_CORRELATOR (CORRELATOR_ID bigint generated by default as identity,
CORRELATOR_KEY varchar(255), PROC_ID bigint, primary key (CORRELATOR_ID))
ERROR - CoreMessageLogger_$logger.error(3573) | Table "BPEL_CORRELATOR" already
exists; SQL statement:
create table BPEL_CORRELATOR (CORRELATOR_ID bigint generated by default as identity,
CORRELATOR_KEY varchar(255), PROC_ID bigint, primary key (CORRELATOR_ID)) [42101-124]
ERROR - CoreMessageLogger_$logger.unsuccessfulCreate(2374) | HHH00389:Unsuccessful: create
table BPEL_CORSET_PROP (ID bigint generated by default as identity, CORRSET_ID bigint,
PROP_KEY varchar(255), PROP_VALUE varchar(255), primary key (ID))
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira