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

Bug 347620

Summary: Test DelimitedPUTestSuite.testReadImage fails on MaxDB
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: konstantin.schwed, krum.tsvetkov, tom.ware
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=317597
Whiteboard: maxdb submitted_patch
Attachments:
Description Flags
Proposed patch adrian.goerler: iplog+, adrian.goerler: review+

Description Adrian Goerler CLA 2011-05-30 06:10:52 EDT
On MaxDB, the test org.eclipse.persistence.testing.tests.jpa.delimited.DelimitedPUTestSuite.testReadImage 

from the test suite

eclipselink.jpa.test fails:

junit.framework.AssertionFailedError: SimpleImage was not properly read back in
	at org.eclipse.persistence.testing.tests.jpa.delimited.DelimitedPUTestSuite.testReadImage(DelimitedPUTestSuite.java:170)
	at org.eclipse.persistence.testing.framework.junit.JUnitTestCase.runBare(JUnitTestCase.java:535)
	at org.eclipse.persistence.testing.framework.TestExecutor.execute(TestExecutor.java:248)
	at org.eclipse.persistence.testing.framework.TestModel.execute(TestModel.java:211)
	at org.eclipse.persistence.testing.framework.TestCollection.run(TestCollection.java:313)
Comment 1 Adrian Goerler CLA 2011-05-31 09:34:50 EDT
The test uses the entity SimpleImage, which has an attribute

    @Lob
    @Column(length=4000)
    public Byte[] getPicture()


On MaxDB, the forward mapper creates a 

CHAR 400 BYTE 

column for this attribute. This is due to the fact that the forward mapper does not know that the attributed has an @Lob annotation (see bug 317597).

The CHAR BYTE column does not preserve the length of the data stored, wich is expected by the test.
Comment 2 Konstantin Schwed CLA 2011-06-01 07:05:14 EDT
Created attachment 197082 [details]
Proposed patch

In the former version, the types byte[] and Byte[] were being mapped to CHAR (n) BYTE for array length under 8000 and to LONG BYTE for arrays of greater length.

With this patch, both byte[] and Byte[] are mapped to LONG BYTE, independent from their length. The problem described by Adrian in the previous comment is solved by this. The core, jpa and wdf tests show no regression.
Comment 3 Adrian Goerler CLA 2011-06-03 03:24:43 EDT
Comment on attachment 197082 [details]
Proposed patch

Reviewed by Adrian
Tested on MaxDB
Approved by Peter
Checked in at # 9502.
Comment 4 Adrian Goerler CLA 2011-06-03 03:25:29 EDT
see above
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:35:23 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink