Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 326968

Summary: MaxDB: size of compound key of the entity TelephoneNumber exceeds MaxDBs limit
Product: z_Archived Reporter: Adrian Goerler <adrian.goerler>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipselink.orm-inbox, krum.tsvetkov, sabine.heider
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: test maxdb
Bug Depends on:    
Bug Blocks: 284657    
Attachments:
Description Flags
patch limiting the size of the primary key
none
limit the size of the primary key of entities CKeyEntity[A|B|C] none

Description Adrian Goerler CLA 2010-10-04 15:57:57 EDT
The entity org.eclipse.persistence.testing.models.jpa.xml.merge.inherited.TelephoneNumber has a compound key:

public class TelephoneNumberPK  {
	public String type;
    protected String number;
    private String areaCode;

...
}

The length of the string components default to 255 each giving a total length of the primary key of 765 unicode characters or 1530 bytes. This exceeds MaxDB's limit of 1024 for the "Total of internal lengths of all columns belonging to an index".

The purpose of the model class TelephoneNumber seems to be to test overriding of a mapping defined in a superclass by XML. Hence, I think the test would not be spoiled by limiting the length of the primary key columns.
Comment 1 Adrian Goerler CLA 2010-10-04 16:26:35 EDT
Created attachment 180206 [details]
patch limiting the size of the primary key

This patch solves failures of the following tests:

EntityMappingsMergeInheritedJUnitTestCase.
 testOneToManyRelationships,
 testVerifyOneToManyRelationships,
 testMappedSuperclassTransientField,
 testTransientField and
 testDeleteBeerConsumer.
Comment 2 Adrian Goerler CLA 2010-10-05 09:21:40 EDT
Tested on MaxDB.
Reviewed by Tom.
Checked in at #8312.
Comment 3 Adrian Goerler CLA 2010-10-05 10:09:51 EDT
Need to reopen this ticket. The same issue occurs with the entities 

org.eclipse.persistence.testing.models.jpa.ddlgeneration.CKeyEntityA, CKeyEntityB and CKeyEntityC. Here, the issue is even more pronounced: 

There is a join table relationshsip between CKeyEntityB and CKeyEntityC. 
The primary key of the join table is the full row, which is composed of the PKs of CKeyEntityB and CKeyEntityC. This effectively limits the sums of the widths of the PKs of CKeyEntityB and CKeyEntityC to 1024 bytes on MaxDB.

Nevertheless, the test suite does not seem to test for the maximum length of the PKs. Hence, I am suggesting to adjust the length of the PK components. Additional, the maximum PK size needs to be documented as a limitation.
Comment 4 Adrian Goerler CLA 2010-10-05 10:21:03 EDT
Created attachment 180245 [details]
limit the size of the primary key of entities CKeyEntity[A|B|C]
Comment 5 Adrian Goerler CLA 2010-10-05 10:36:53 EDT
Comment on attachment 180245 [details]
limit the size of the primary key of entities CKeyEntity[A|B|C]

Fixes issues with the tests 
DDLGenerationJUnitTestSuite 
.testDDLUniqueKeysAsJoinColumns 
.testDDLUnidirectionalOneToMany 
.testManyToManyWithMultipleJoinColumns
Comment 6 Adrian Goerler CLA 2010-10-20 03:00:58 EDT
Resolved by https://bugs.eclipse.org/bugs/attachment.cgi?id=180245
Comment 7 Eclipse Webmaster CLA 2022-06-09 10:31:18 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink