-
1. Re: WildFly 10.1 Hibernate SchemaManagementException
valsaraj007 Apr 19, 2017 8:55 AM (in response to valsaraj007)Upgraded to hibernate 5.1.5 but still getting this:
2017-04-19 18:10:30,113 WARN [org.hibernate.tool.schema.internal.ExceptionHandlerLoggedImpl] (ServerService Thread Pool -- 86) GenerationTarget encountered exception accepting command : Error executing DDL via JDBC Statement: org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL via JDBC Statement
...
Caused by: org.postgresql.util.PSQLException: ERROR: insert or update on table "author_info" violates foreign key constraint "fk8dmiogojwntxbw5acljojkvan"
Detail: Key (author_id)=(5967) is not present in table "author".
-
2. Re: WildFly 10.1 Hibernate SchemaManagementException
tomasg1 Aug 14, 2017 7:59 AM (in response to valsaraj007)1 of 1 people found this helpfulI have the same issue, when upgrading from WildFly 9 to WildFly 10.1, using Oracle database. Seems the keys for foreign constraints changed so we get an exception because Hibernate want's to re-create the foreign key constraint.
Caused by: org.hibernate.tool.schema.spi.SchemaManagementException: Unable to execute schema management to JDBC target [alter table AccessRulesData add constraint FKdaev24clq6yofynpsh4kuojno foreign key (AdminGroupData_accessRules) references AdminGroupData]
<snip>
Caused by: java.sql.SQLSyntaxErrorException: ORA-02275: such a referential constraint already exists in the table
-
3. Re: WildFly 10.1 Hibernate SchemaManagementException
tomasg1 Sep 7, 2017 10:20 AM (in response to tomasg1)1 of 1 people found this helpfulConfirmed that removing those constraints and letting WildFly/Hibernate create new constraints during startup makes it work. It is really bad that it breaks upgrades though.
-
4. Re: WildFly 10.1 Hibernate SchemaManagementException
valsaraj007 Sep 7, 2017 10:23 AM (in response to tomasg1)Removing existing constraints or renaming old constraints with new name will work.
-
5. Re: WildFly 10.1 Hibernate SchemaManagementException
tomasg1 Sep 7, 2017 10:28 AM (in response to valsaraj007)This will cause breakage if you are running in a cluster though, and want to make a rolling upgrade across many servers.
-
6. Re: WildFly 10.1 Hibernate SchemaManagementException
valsaraj007 Sep 7, 2017 11:06 AM (in response to tomasg1)Yes.