Bug 979103

Summary: [One-off patch] Multiple fixes for Hibernate unique keys and foreign keys in ORM 4.2.0.Final
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Ricardo Martinelli de Oliveira <rmartine>
Component: HibernateAssignee: Brett Meyer <brmeyer>
Status: CLOSED CURRENTRELEASE QA Contact: Zbyněk Roubalík <zroubali>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.1.0CC: brmeyer, cobrien, jawilson, myarboro, rsvoboda, theute
Target Milestone: ---   
Target Release: One-off release   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
PATCH NAME: BZ-979103 PRODUCT NAME: JBoss Enterprise Application Platform VERSION: 6.1.0 SHORT DESCRIPTION: Multiple fixes for Hibernate unique keys and foreign keys in ORM 4.2.0.Final LONG DESCRIPTION: Multiple fixes for Hibernate unique keys and foreign keys in ORM 4.2.0.Final Identifier too long https://hibernate.atlassian.net/browse/HHH-1904 Configuration#generateSchemaUpdateScript does not create unique constraints https://hibernate.atlassian.net/browse/HHH-8092 Natural IDs generating one UniqueKey per Column https://hibernate.atlassian.net/browse/HHH-8178 Make unique constraint handling on schema update configurable https://hibernate.atlassian.net/browse/HHH-8162 Make generated constraint names short and non-random https://hibernate.atlassian.net/browse/HHH-8217 DenormalizedTable FK constraint names can be too long https://hibernate.atlassian.net/browse/HHH-8269 Incorrect "unique-key" naming comment in docs https://hibernate.atlassian.net/browse/HHH-8273 union-subclass generates bad alter table for unique constraint https://hibernate.atlassian.net/browse/HHH-8275 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-979103 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-979103.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: SUPERSEDED BY: CREATOR: Brett Meyer DATE: 11 July 2013
Story Points: ---
Clone Of: 979098 Environment:
Last Closed: 2013-07-25 20:11:41 UTC Type: Support Patch
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 962421, 979098, 981720    
Bug Blocks: 990362, 991581    
Attachments:
Description Flags
patched hibernate module
none
patched hibernate module none

Description Ricardo Martinelli de Oliveira 2013-06-27 15:26:18 UTC
+++ This bug was initially created as a clone of Bug #979098 +++

Hibernate 4.2.0.Final (EAP 6.1.0) included changes to how unique keys and foreign keys were generated (both default to using constraints in "alter table" statements).  Multiple issues were found and fixed in commits spanning 4.2.1.Final to 4.2.3.Final.

This is fairly high priority and should be considered for EAP 6.1.1.  It may affect anyone using schema generation and un-named unique or foreign keys.

https://hibernate.atlassian.net/browse/HHH-1904
https://hibernate.atlassian.net/browse/HHH-8092
https://hibernate.atlassian.net/browse/HHH-8178
https://hibernate.atlassian.net/browse/HHH-8162
https://hibernate.atlassian.net/browse/HHH-8217
https://hibernate.atlassian.net/browse/HHH-8269
https://hibernate.atlassian.net/browse/HHH-8273
https://hibernate.atlassian.net/browse/HHH-8275

--- Additional comment from Brett Meyer on 2013-06-27 11:18:08 EDT ---

Note that there may be some concerns about backward compatability with the fixes.  They do change the strategy used for automatic generation of constraint names.  However, we're specifically fixing issues where this generation was not deterministic in 4.2.0.Final, so it's a moot point.

Comment 2 Brett Meyer 2013-06-27 22:52:13 UTC
Created attachment 766357 [details]
patched hibernate module

Comment 3 Rostislav Svoboda 2013-07-01 08:38:43 UTC
Brett, this looks like real one-off. If you want to have these fixes in EAP 6.1.1 I would suggest to create new BZ and remove eap-6.1.1 flag from this BZ.

it's really confusing - is this BZ meant to be fixed in EAP 6.1.1 ?

Comment 4 Rostislav Svoboda 2013-07-01 08:58:10 UTC
I found https://bugzilla.redhat.com/show_bug.cgi?id=979098 for EAP 6.1.1

I think eap-6.1.1 flag should be removed.

Comment 5 Brett Meyer 2013-07-01 15:49:55 UTC
The eap-6.1.1 has been set automatically, lately -- not sure why.  Removing.

Comment 13 Zbyněk Roubalík 2013-07-08 08:35:59 UTC
Attached zip should countain README file with patching instructions. Could you please add the README file into the zip?

Thank you

Comment 14 Brett Meyer 2013-07-11 23:57:38 UTC
Created attachment 772485 [details]
patched hibernate module

Comment 15 Zbyněk Roubalík 2013-07-17 10:22:33 UTC
No regressions were found and the issue was verified. QA Passed. 

MD5 sum for tested files:
303d93111f3479eedf87fe572a2338f8  BZ-979103.zip
97b3798f16afc2d1043077f528832ed4  hibernate-core-4.2.0.Final-redhat-1-BZ-979103.jar