Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 277079 - EmbeddedId's fields are null when using LOB with fetchtype LAZY
Summary: EmbeddedId's fields are null when using LOB with fetchtype LAZY
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P2 major with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-20 04:21 EDT by Kristian Rye Vennesland CLA
Modified: 2022-06-09 10:27 EDT (History)
4 users (show)

See Also:


Attachments
File containing necessary SQL and Javacode (5.06 KB, text/plain)
2009-05-20 04:21 EDT, Kristian Rye Vennesland CLA
guy.pelletier: iplog+
Details
Proposed changes (15.04 KB, patch)
2011-01-11 13:37 EST, Guy Pelletier CLA
no flags Details | Diff
Suggested update to the patch (2.66 KB, patch)
2011-01-11 15:46 EST, Andrei Ilitchev CLA
no flags Details | Diff
Updated patch with Andrei's changes (14.16 KB, patch)
2011-01-12 09:40 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 Kristian Rye Vennesland CLA 2009-05-20 04:21:48 EDT
Created attachment 136450 [details]
File containing necessary SQL and Javacode

The embeddedid's fields are null when the entityclass has a LOB-column that uses a Basic-annotation to fetch lazily. Remove the annotiation and the embeddedid's fields are retrieved as expected. 

This bug has been witnessed on both Oracle and MS-SQL platforms, and different tables.

To reproduce, simply create a table containing a compound primarykey and a LOB-field and create an entityclass for that table. Set the fetchtype to LAZY for the LOB-field and try and retrieve some rows. 
SQL- and Java-file for doing this is attached.
Comment 1 Tom Ware CLA 2009-05-20 13:37:09 EDT
Setting target an priority.  See the following link for an explanation:

http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines
Comment 2 Peter Krogh CLA 2009-11-27 13:41:28 EST
This bug fix did not make the cut off for 2.0.0. We are deferring the bugs to Future where we can properly sort them all together based on community votes and severity. We will then assign them accordingly to future patch sets and releases.
Comment 3 Peter Krogh CLA 2009-11-30 11:37:01 EST
Changing the priority of the bugs that have been recently triaged to future.  Targetting them to P2 will differentiate them from the P3s that have been triaged into future earlier.
Comment 4 Missing name CLA 2010-12-03 06:17:54 EST
Tried with Embedded, not EmbeddedId and it's broken too.
2.0.1.v20100213-r6600
Comment 5 Guy Pelletier CLA 2011-01-11 08:55:16 EST
As a workaround for the time being you can set the following property to avoid this error:

eclipselink.weaving.fetchgroups=false
Comment 6 Guy Pelletier CLA 2011-01-11 13:37:02 EST
Created attachment 186539 [details]
Proposed changes
Comment 7 Andrei Ilitchev CLA 2011-01-11 15:46:59 EST
Created attachment 186565 [details]
Suggested update to the patch

Instead of altering shouldReadAllMapping method signature to take a descriptor I suggest to clone the query and remove the fetch group.

Currently FetchGroups don't support aggregates but when (and if) the support is added it would be a simple matter of extracting the nested fetch group corresponding to the mapping (just like in ReferenceMapping case) where the current patch always removes the fetch group.
Comment 8 Guy Pelletier CLA 2011-01-12 09:40:47 EST
Created attachment 186639 [details]
Updated patch with Andrei's changes
Comment 9 Guy Pelletier CLA 2011-01-12 11:00:42 EST
Changes have been submitted.

Verified by: Andrei Ilitchev

New test (testLAZYLOBWithEmbeddedId) added to the DDLGenerationJUnitTestSuite. All tests pass (full regression test
suite, extended jpa test suite and core lrg)
Comment 10 Guy Pelletier CLA 2011-02-23 11:38:12 EST
Fix was backported to 2.1.3 and 2.2.1
Comment 11 Eclipse Webmaster CLA 2022-06-09 10:27:07 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink