Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 311248 - Unregistered listener exception changing joining strategy from mappedBy to joinColumns
Summary: Unregistered listener exception changing joining strategy from mappedBy to jo...
Status: VERIFIED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: General (show other bugs)
Version: 2.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 2.3 RC1   Edit
Assignee: Karen Butzke CLA
QA Contact:
URL:
Whiteboard: PMC_approved
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-30 17:41 EDT by Karen Butzke CLA
Modified: 2010-05-10 15:37 EDT (History)
3 users (show)

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


Attachments
exception stack trace (5.35 KB, text/plain)
2010-04-30 17:41 EDT, Karen Butzke CLA
no flags Details
proposed patch against head (8.71 KB, patch)
2010-05-05 16:13 EDT, Karen Butzke 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 2010-04-30 17:41:43 EDT
Created attachment 166694 [details]
exception stack trace

Start with the following Entity and select the foo mapping.  In the JPA Details view change the joining strategy from 'mapped by' to 'join columns' and you will get the attached stack trace.

@Entity
public class Foo {
	@OneToMany(mappedBy = "")
	private String foo;
}
Comment 1 Karen Butzke CLA 2010-05-05 16:13:08 EDT
Created attachment 167221 [details]
proposed patch against head

The attached patch changes the UI to not call the unset*strategy() API when a radio button is deselected.  A deselected radio button means that another radio button was selected.  Thus this code is redundant and is causing problems.  I think we should also remove the unset*strategy() API, but that can wait until the next release.  I added TODO comments to that API and will enter another bug as a reminder.
Comment 2 Paul Fullbright CLA 2010-05-05 16:47:15 EDT
I do not see the stack trace with the patch applied.
Comment 3 Karen Butzke CLA 2010-05-05 16:48:44 EDT
Paul has reviewed this patch and agrees with the change.  This is also how we approached the DerivedIdentity radio buttons where the model follows the same pattern.
Comment 4 Neil Hauge CLA 2010-05-06 12:05:43 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. 

At first I didn't think this bug merited inclusion in RC1, but after digging deeper found that this is a race condition that can have undetermined results, some worse than others, and some perhaps unknown.  The bug also results in a flaky looking UI in this case.

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

N/A

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

Multiple devs have tested this fix.

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

See comment #1.  Paul and I have reviewed the fix.

* What is the risk associated with this fix? 

Low risk.
Comment 5 Karen Butzke CLA 2010-05-06 14:14:08 EDT
Checked in to HEAD.  Entered bug 311945 to remove the appropriate provisional API in the next release.
Comment 6 Karen Butzke CLA 2010-05-10 15:37:28 EDT
verified fixed in build WTP-I-3.2.0-20100507065327