Bug 991581 - One-off patch for BZ 991578 - Foreign key reference generated before unique constraint exists
One-off patch for BZ 991578 - Foreign key reference generated before unique c...
Status: CLOSED CURRENTRELEASE
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Hibernate (Show other bugs)
6.1.0
Unspecified Unspecified
unspecified Severity high
: GA
: One-off release
Assigned To: Brett Meyer
Martin Simka
Russell Dickenson
:
Depends On: 979103 991578
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-02 14:49 EDT by Ricardo Martinelli de Oliveira
Modified: 2015-09-01 00:00 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
PATCH NAME: BZ-991581 PRODUCT NAME: JBoss Enterprise Application Platform VERSION: 6.1.0 SHORT DESCRIPTION: HHH-8390 Foreign key reference generated before unique constraint exists LONG DESCRIPTION: HHH-8390 Foreign key reference generated before unique constraint exists https://hibernate.atlassian.net/browse/HHH-8390 MANUAL INSTALL INSTRUCTIONS: Backup and remove the following files: $JBOSS_HOME/modules/system/layers/base/org/hibernate/main/hibernate-core-4.2.0.Final-redhat-1.jar $JBOSS_HOME/modules/system/layers/base/org/hibernate/main/module.xml Extract the patched files by either: Using unzip: unzip -d $JBOSS_HOME/ BZ-991581 Or by extracting the files from the zip to the following locations: $JBOSS_HOME/modules/system/layers/base/org/hibernate/main/hibernate-core-4.2.0.Final-redhat-1-BZ-991581.jar $JBOSS_HOME/modules/system/layers/base/org/hibernate/main/module.xml Instructions to uninstall: Restore the following files that were backed up before the patch was installed: $JBOSS_HOME/modules/system/layers/base/org/hibernate/main/hibernate-core-4.2.0.Final-redhat-1.jar $JBOSS_HOME/modules/system/layers/base/org/hibernate/main/module.xml COMPATIBILITY: DEPENDENCIES: JBoss Enterprise Application Platform 6.1.0 SUPERSEDES: 979103 SUPERSEDED BY: CREATOR: Brett Meyer DATE: 2 August 2013
Story Points: ---
Clone Of: 991578
Environment:
Last Closed: 2013-09-05 09:47:18 EDT
Type: Support Patch
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patched Hibernate module (3.99 MB, application/zip)
2013-08-02 16:42 EDT, Brett Meyer
no flags Details

  None (edit)
Description Ricardo Martinelli de Oliveira 2013-08-02 14:49:19 EDT
+++ This bug was initially created as a clone of Bug #991578 +++

In H2 the generated schema works:
[main            ] DEBUG  - 18:27:01,763 - org.hibernate.SQL: 
    create table Item (
        id bigint not null,
        name varchar(255),
        SELLER_CUSTOMERNR varchar(255),
        primary key (id)
    )
[main            ] DEBUG  - 18:27:01,769 - org.hibernate.SQL: 
    create table USERS (
        id bigint not null,
        customerNr varchar(255),
        primary key (id)
    )
[main            ] DEBUG  - 18:27:01,769 - org.hibernate.SQL: 
    alter table Item 
        add constraint FK_76d41162ea614944b8333c7c440 
        foreign key (SELLER_CUSTOMERNR) 
        references USERS (customerNr)
[main            ] DEBUG  - 18:27:01,775 - org.hibernate.SQL: 
    alter table USERS 
        add constraint UK_8a5ec890d05a4545a1e9660dea0 unique (customerNr)
On Oracle this fails, as the foreign key reference is actually checked before the UNIQUE constraint is generated.
http://www.techonthenet.com/oracle/errors/ora02270.php
Comment 1 Brett Meyer 2013-08-02 16:29:06 EDT
This patch will be based off of 979103
Comment 2 Brett Meyer 2013-08-02 16:41:31 EDT
This should be considered as superseding 979103 altogether, in my opinion.
Comment 3 Brett Meyer 2013-08-02 16:42:49 EDT
Created attachment 782180 [details]
patched Hibernate module
Comment 5 Martin Simka 2013-08-06 09:23:00 EDT
No regressions were found and the issue was verified. QA Passed. 

md5sum of tested files:
89bab72cce8577e47e57dea2790558e6  BZ991581.zip
c8d720de9d682b212e0aed565e9aad84  BZ-991581.zip
6a6cc939a97fd1b2fc9a9676ea8639d2  hibernate-core-4.2.0.Final-redhat-1-BZ-991581.jar
d6020f8a16feb5ca50b39b105c1acde9  module.xml

Note You need to log in before you can comment on or make changes to this bug.