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

Bug 333760

Summary: testPrimaryKeyJoinColumns() failed on DB2 9.7 with universal driver
Product: z_Archived Reporter: Yiping Zhao <yiping.zhao>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipselink.orm-inbox, guy.pelletier
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Fix none

Description Yiping Zhao CLA 2011-01-07 11:32:49 EST
Guy added the new test recently in revision 8767 on Jan 4th as fix of bug 330628, the test failed on DB2 with following error:

Error persisting new country with city, states and zips : javax.persistence.RollbackException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.3.0.v20110107-r8781): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: com.ibm.db2.jcc.am.mo: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=DEV2.ZIPAREAS, DRIVER=4.7.85 Error Code: -204 Call: INSERT INTO ZipAreas (zip_code, city_name, country_code, state_code) VALUES (?, ?, ?, ?) bind => [4 parameters bound] Query: InsertObjectQuery(org.eclipse.persistence.testing.models.jpa.ddlgeneration.ZipArea@17c4bf4a) 

junit.framework.AssertionFailedError: Error persisting new country with city, states and zips : javax.persistence.RollbackException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.3.0.v20110107-r8781): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.ibm.db2.jcc.am.mo: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=DEV2.ZIPAREAS, DRIVER=4.7.85
Error Code: -204
Call: INSERT INTO ZipAreas (zip_code, city_name, country_code, state_code) VALUES (?, ?, ?, ?)
bind => [4 parameters bound]
Query: InsertObjectQuery(org.eclipse.persistence.testing.models.jpa.ddlgeneration.ZipArea@17c4bf4a)
at org.eclipse.persistence.testing.tests.jpa.ddlgeneration.DDLGenerationJUnitTestSuite.testPrimaryKeyJoinColumns(DDLGenerationJUnitTestSuite.java:354)
at org.eclipse.persistence.testing.framework.junit.JUnitTestCase.runBare(JUnitTestCase.java:499)
at org.eclipse.persistence.testing.framework.TestExecutor.execute(TestExecutor.java:248)
at org.eclipse.persistence.testing.framework.TestModel.execute(TestModel.java:208)
at org.eclipse.persistence.testing.framework.TestCollection.run(TestCollection.java:313)
Comment 1 Guy Pelletier CLA 2011-01-10 11:17:34 EST
Created attachment 186399 [details]
Fix

Testing model change. DB2 has a limit on the combined length of composite primary key fields. This corrects that allowing the model to properly create the table and subsequently pass the new test added.
Comment 2 Guy Pelletier CLA 2011-01-10 11:20:09 EST
Changes have been submitted.

Verified by: Yiping Zhao

New test ( testOptionalPrimaryKeyJoinColumnRelationship) added to the DDLGenerationJUnitTestSuite now passes on DB2.
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:23:35 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink