Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 347620 - Test DelimitedPUTestSuite.testReadImage fails on MaxDB
Summary: Test DelimitedPUTestSuite.testReadImage fails on MaxDB
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard: maxdb submitted_patch
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-30 06:10 EDT by Adrian Goerler CLA
Modified: 2022-06-09 10:35 EDT (History)
3 users (show)

See Also:


Attachments
Proposed patch (16.88 KB, patch)
2011-06-01 07:05 EDT, Konstantin Schwed CLA
adrian.goerler: iplog+
adrian.goerler: review+
Details | Diff

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