Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 333760 - testPrimaryKeyJoinColumns() failed on DB2 9.7 with universal driver
Summary: testPrimaryKeyJoinColumns() failed on DB2 9.7 with universal driver
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-07 11:32 EST by Yiping Zhao CLA
Modified: 2022-06-09 10:23 EDT (History)
2 users (show)

See Also:


Attachments
Fix (2.36 KB, patch)
2011-01-10 11:17 EST, Guy Pelletier CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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