This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 278947 - infinite update when adding binary static inner class to orm.xml
Summary: infinite update when adding binary static inner class to orm.xml
Status: VERIFIED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: General (show other bugs)
Version: 2.2   Edit
Hardware: PC Windows XP
: P2 major (vote)
Target Milestone: 2.2 RC4   Edit
Assignee: Brian Vosburgh CLA
QA Contact:
URL:
Whiteboard: PMC_approved
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-03 09:30 EDT by Karen Butzke CLA
Modified: 2009-06-08 12:56 EDT (History)
4 users (show)

See Also:
tranle1: pmc_approved?
raghunathan.srinivasan: pmc_approved+
neil.hauge: pmc_approved? (naci.dai)
neil.hauge: pmc_approved? (deboer)
neil.hauge: pmc_approved+
neil.hauge: pmc_approved? (kaloyan)
neil.hauge: review+


Attachments
candidate patch (1.98 KB, patch)
2009-06-05 00:02 EDT, Brian Vosburgh CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Karen Butzke CLA 2009-06-03 09:30:07 EDT
Probably an unlikely use case, but leads to the update thread running infintitely.  An easy way to reproduce is to add java.util.logging.LogManager.LogNode to the orm.xml file.  How I managed to hit this is not important :)

In AbstractJpaProject.getJavaResourcePersistentType(typeName) the typeName and qualifiedName don't match because the type name uses a '.' for the inner class and the qualified name uses '$'.  This leads to that BinaryPersistentType being rebuilt during update and the virtual persistent attributes not matching when updating the OrmPersistentType.
Comment 1 Neil Hauge CLA 2009-06-03 12:05:42 EDT
Consider for RC4, depending on the fix.  If at all risky, we can push this to 2.2.1.
Comment 2 Brian Vosburgh CLA 2009-06-05 00:02:22 EDT
Created attachment 138367 [details]
candidate patch

Minor tweaks to get dot-separated name from IType.
Comment 3 Neil Hauge CLA 2009-06-05 14:19:54 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 bug can result in data loss, since when encountered the user must forcefully kill the eclipse process to proceed.  I have it marked as Major instead of Critical since the case is not "main-path", but is certainly a valid and possible use case. 

* Is there a work-around? If so, why do you believe the work-around is
insufficient? 
There is no workaround, except for the user to avoid this particular mapping case.

* How has the fix been tested? Is there a test case attached to the bugzilla
record? Has a JUnit Test been added? 
This fix has been tested by Brian, Karen, and myself.  We have done ad-hoc testing to look for regressions, and have run the JUnit tests.

* Give a brief technical overview. Who has reviewed this fix? 
AbstractJpaProject.getJavaResourcePersistentType(typeName) will now find referenced static inner classes since we now get a fully qualified, dot-separated name for static inner classes from the IType.  This should only affect nested classes that are external to the JPA project or in binary form.

* What is the risk associated with this fix?
I am only proposing this change due to the fact that the fix is low risk.  If it was medium risk, I would recommend this for the first service release.  I think that the risk of the fix is appropriate for RC4 since the bug is pretty severe.
Comment 4 Raghunathan Srinivasan CLA 2009-06-05 16:17:32 EDT
Low risk fix for 'major' severity issue.
Comment 5 David Williams CLA 2009-06-07 00:05:35 EDT
I think borderline, sine described as "an unlikely use case" but the problem does seem bad, and the fix especially simple and isolated, so I approve. 
Comment 6 Tran Le CLA 2009-06-08 00:29:10 EDT
Committed and released into R2_2_maintenance branch, and also committed into HEAD.
Comment 7 Neil Hauge CLA 2009-06-08 09:46:57 EDT
Looks like we lost David's +1 flag by accident.
Comment 8 Neil Hauge CLA 2009-06-08 09:48:53 EDT
And mine.
Comment 9 Neil Hauge CLA 2009-06-08 12:56:44 EDT
Verified in wtp-sdk-S-3.1RC4-20090608061637.