Bug 1299734

Summary: [TEST] (6.4.x) Derived identity tests failing with DB2
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Jan Martiska <jmartisk>
Component: HibernateAssignee: Gail Badner <gbadner>
Status: CLOSED CURRENTRELEASE QA Contact: Martin Simka <msimka>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.4.6CC: bbaranow, bmaxwell, gbadner, jbilek, jmartisk, msimka, smarlow
Target Milestone: CR1   
Target Release: EAP 6.4.8   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-01-17 12:39:10 UTC Type: Bug
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:    
Bug Blocks: 1279553, 1315479    

Description Jan Martiska 2016-01-19 07:16:06 UTC
This affects most tests in the package org/hibernate/test/annotations/derivedidentities when running with DB2

The tests need two adjustments:
- all primary key columns in derived entities need to be declared non-null, because db2 requires primary key components to explicitly be non-null
- if Employee.firstName and PolicyId.type are left to their default size (255) then db2 complains that it can't handle such long primary keys:

    07:55:18,511 ERROR SchemaExport:426 - HHH000389: Unsuccessful: create table Policy (type varchar(255) not null, dep_emp_firstName varchar(255) not null, dep_emp_lastName varchar(255) not null, dep_name varchar(255) not null, primary key (dep_emp_firstName, dep_emp_lastName, dep_name, type))
    07:55:18,511 ERROR SchemaExport:427 - DB2 SQL Error: SQLCODE=-613, SQLSTATE=54008, SQLERRMC=DEP_EMP_FIRSTNAME..., DRIVER=4.17.29

---> it works if these columns are trimmed to a smaller max. size, eg. 80

Comment 1 Jan Martiska 2016-01-19 07:24:40 UTC
Upstream issue: https://hibernate.atlassian.net/browse/HHH-10457
PR sent to upstream component: https://github.com/hibernate/hibernate-orm/pull/1225/files

Comment 2 Jan Martiska 2016-01-19 07:28:35 UTC
Does not seem to affect EAP 7.x because JBEAP-1595 is applied there

Comment 3 Mike McCune 2016-03-28 22:38:41 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 4 Jan Martiska 2016-04-07 08:16:12 UTC
Requires upgrade to Hibernate 4.2.23.Final (not yet released)

Comment 5 Gail Badner 2016-04-13 04:14:54 UTC
Should this block the component upgrade BZ: 
https://bugzilla.redhat.com/show_bug.cgi?id=1315479 ?

Comment 10 Jiří Bílek 2016-05-06 07:28:52 UTC
Verified with EAP 6.4.8.CP.CR2.

Comment 11 Petr Penicka 2017-01-17 12:39:10 UTC
Retroactively bulk-closing issues from released EAP 6.4 cumulative patches.