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

Bug 346535

Summary: Invalid validation error for Converter when eclipselink-orm.xml is used
Product: [WebTools] Dali JPA Tools Reporter: Neil Hauge <neil.hauge>
Component: GeneralAssignee: Paul Fullbright <paul.fullbright>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P1 CC: brian.vosburgh, david_williams, jolene.moffitt, raghunathan.srinivasan
Version: 3.0Flags: david_williams: pmc_approved+
raghunathan.srinivasan: pmc_approved+
neil.hauge: pmc_approved? (naci.dai)
neil.hauge: pmc_approved? (deboer)
neil.hauge: pmc_approved? (neil.hauge)
neil.hauge: pmc_approved? (kaloyan)
neil.hauge: pmc_approved? (cbridgha)
neil.hauge: review+
Target Milestone: 3.0 RC3   
Hardware: PC   
OS: Windows 7   
Whiteboard: PMC_approved
Attachments:
Description Flags
proposed patch none

Description Neil Hauge CLA 2011-05-19 16:20:07 EDT
Currently if you properly define a converter in a Java entity and then override that entity in eclipselink-orm.xml you will get the following invalid error message.

Duplicate converter "<name>" defined in this persistence unit

This is a regression that appears to have been introduced in RC1.
Comment 1 Neil Hauge CLA 2011-05-23 11:20:50 EDT
This bug is fixed by the patch posted in bug 346005 but we need a more isolated fix for the 3.0 release if possible.
Comment 2 Paul Fullbright CLA 2011-05-24 11:46:27 EDT
Created attachment 196456 [details]
proposed patch

Subset of other patch.  Changed isVirtual calculation for persistent attributes, and changed so converters are only built if the attribute is not virtual.
Comment 3 Neil Hauge CLA 2011-05-24 14:51:23 EDT
Patch looks good.  My testing has confirmed the fix and I haven't found any regressions.  Nan is also doing some testing.
Comment 4 Neil Hauge CLA 2011-05-24 17:44:15 EDT
    Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug" (requested by an adopter) please document it as such. 

This patch fixes 2 RC3 targeted bugs that are tied together.  The bug causes invalid Errors in the case of an EclipseLink mapping file override, and the other bug 346498 causes an NPE that causes validation to stop, resulting in non-reported real errors.

    Is there a work-around? If so, why do you believe the work-around is insufficient? 

No workaround, which is what makes this particularly onerous.

    How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added? 

The fix has been tested by Paul, Nan, and myself.

    Give a brief technical overview. Who has reviewed this fix? 

See comment 2 for overview.  I have reviewed the fix.

    What is the risk associated with this fix? 

Low risk, isolated fix.  This is a greatly simplified and isolated fix from where we started (see bug 346005).  An effort was made here to fix this with the minimal possible change and risk.  It also takes out 2 RC3 targeted bugs.
Comment 5 Paul Fullbright CLA 2011-05-24 20:30:15 EDT
committed for rc3
Comment 6 Jolene Moffitt CLA 2011-06-28 13:30:59 EDT
Verified in Build I-3.3.0RC4-20110603221533

Verified you add converter type entity to EL orm mapping file and override the converter without error.  See the link to view test steps for verification. http://wiki.eclipse.org/Dali_3.0_RC3