This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 74630 - CMR Relationships are not synchronized
Summary: CMR Relationships are not synchronized
Status: RESOLVED WONTFIX
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Sun Appserver 8 (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: _ pcw
URL:
Keywords:
Depends on: 73926 75757
Blocks:
  Show dependency tree
 
Reported: 2006-04-08 15:46 UTC by whartung
Modified: 2007-12-10 21:16 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description whartung 2006-04-08 15:46:53 UTC
Refer to issue #74629 to set up tables for this issue

+ Right click a tab in the Editor Window, and select "Close All Documents"
+ Open "ejb-jar.xml" and view the CMR tab
+ Open "sun-ejb-jar.xml"
+ Select the Customers bean
+ Click on the "map relationship" column for the ordersBean field.
+ Observe the first dialog and notice that things look OK.
+ Click "Cancel"

+ Go back to "ejb-jar.xml"
+ Select the OrdersBean-CustomerBean relation and click "Edit"
+ Uncheck the "Create CMR Field" for the OrdersBean on the left.
+ Click "OK"
+ Return to "sun-ejb-jar.xml"
+ Select CustomerBean
+ Click on the "map relationship" column for the ordersBean field.
+ Observe the Red X box for the "Related Field"
+ Click "Cancel"

+ Go back to "ejb-jar.xml"
+ Select the OrdersBean-CustomerBean relation and click "Edit"
+ Reverse the Relationship
+ On the left hand side, select "CustomerBean" from the drop down
+ Place "Customer-has-orders" in the Role Name
+ Select the "One" check box
+ Select "Cascade Delete"
+ Select "Create CMR Field"
+ Put "orders" in "Field Name"
+ On the right hand side, select "OrdersBean" from the drop down
+ Make Role Name blank
+ Select the "Many" checkbox
+ Ensure "Cascade Delete" is unchecked
+ Ensure "Create CMR Field" is unchecked
+ Click "OK"
+ Return to "sun-ejb-jar.xml"
+ Select CustomerBean
+ Click on the "map relationship" column for the orders field.
+ Observe "Related Bean" now says "<Choose Related Class>" and that the "..."
button is diabled.
+ Observe "Related Field" is empty
+ Observe "Primary Table" is "<unmapped>"
+ Observer "Next >" button is disabled.
+ Click "Cancel"

+ Go back to "ejb-jar.xml"
+ Delete the "OrdersBean-CustomerBean" relation
+ Create a new Relation, following the previous scenario
+ Observe in "sun-ejb-jar.xml" the same symptoms

+ Close NetBeans
+ Select "Save All"
+ Open NetBeans
+ Observe that only the "ejb-jar.xml" window is open, rather than both
"ejb-jar.xml" and "sun-ejb-jar.xml"
+ Observe in the CMR tab that the Original OrdersBean-CustomerBean relation that
we both renamed and deleted is still there.

I have also been getting NPE's around this time, but I haven't got a duplicating
scenario for this
Comment 1 Martin Adamek 2006-04-10 09:10:27 UTC
Thanks for reporting. According to bug priority guidelines I am decreasing to P2.
Comment 2 Sherold Dev 2006-04-28 12:25:35 UTC
The problem seems to be in the sunappserv plug-in, in the sun-ejb-jar.xml editor
more specifically. Reassiging to Peter for better evaluation.
Comment 3 _ pcw 2006-04-29 08:30:03 UTC
I reproduced this in NB 5.0 FCS, sort of --

I did observe the disabled ... button, etc. after both sets of detailed steps.

I did _not_ observe the original relationship being "restored" on restart.  In
my case, it was as expected and both the CMP Relationships view and XML text
reflected the editing actions performed.  Did you check for any exceptions in
the log file?

Comment on sun config editor not being restored -- this is deliberate. 
Historically, there was/were a bug(s) that the point during startup the the
config editor was being restored was before j2eeserver module and the project
were fully initialized and it was causing problems, so we just disabled it.  I
have not had time to reinvestigate restoring this behavior, it is a low priority.

Finally, in NB 5.5 release55/release55_beta branchs, the first block of steps
(creating and viewing the entity beans for the first time) is showing several
exceptions in the log and I observed that the relationship names are "null-1",
etc. which is clearly wrong.  There are further problems with the data in the
sun configuration editor.

Referring to Rochelle to fix the ... bug and file appropriate bugs on the NB 5.5
issues.
Comment 4 Rochelle Raccah 2006-05-01 22:53:07 UTC
Peter, when I go to the CMP Relationships tab in the ejb-jar.xml multiview
editor, all the relationships are named null-1, null-2, etc.  I think the sun
config editor for cmp mappings is getting the name from there.  If you agree,
and that is the only problem (causing the others), then I think the category
should be switched to j2eeserver.  What do you think? 
Comment 5 Rochelle Raccah 2006-05-01 23:03:10 UTC
Also, most of the exceptions during creation of the beans are NNModelBuilder
exceptions which are filed as issue 73926.
Comment 6 _ pcw 2006-05-02 00:30:22 UTC
I agree with you on the probably source of the "null-#" names, but that should
be filed as a new bug.

This bug should remain as representing the "disabled '...' button" in NB 5.0
under the steps described by the submitter.  Near as I can tell, we can't
reproduce this bug in NB 5.5 until the other issues you (and I) observed are
fixed.  At that point, I expectd we'd see the same behavior as exhibited in 5.0.
Comment 7 Rochelle Raccah 2006-05-02 01:24:39 UTC
I filed the null naming issue as issue 75757.

As far as the "..." -- it is supposed to be disabled in the EJB environment. 
CMR field info is only supposed to be setup in the ejb-jar.xml and related editors.

Is there any part of this bug remaining?  If not, let's close it.  If so, let's
setup dependencies on the null naming and NNModelBuilder issues.
Comment 8 _ pcw 2006-05-02 05:27:24 UTC
I'm ok with closing it except that it seems odd that we would have a field that
deliberately cannot be edited (e.g. the disabled ... button) where the
associated combo says "<Choose Related Class>", which implies to me that it
_can_ be edited.

Of course, if this is just misleading UI, it's definitely not a P2 and should be
downgraded at least to P3.  If you concur, it would also be good to know what
the UI should actually display for this case (e.g. empty disabled combox instead
for example.)  I don't have enough domain expertise to evaluate what correct UI
for this would or could be.
Comment 9 Rochelle Raccah 2006-05-06 01:12:15 UTC
The related class should always be populated in the ejb environment, so if it is
not, this is still a bug.  Let's revisit this after the other issues are
addressed - I've added them to the dependencies for this issue.
Comment 10 Rochelle Raccah 2006-06-14 22:32:06 UTC
I took another look at this and see this behavior:
1) If I open sun-cmp-mappings editor and the map relationship wizard before
removing the create cmr field checkbox, I end up with the red x problem described

2) If I discard changes on everything, then do it again before opening the map
relationship dialog, things look okay.  To me that sounds like there could be a
missing delete cmr field event.  Transferring back to Peter to debug the
plugin's event handling....

However, given the description here, it is not a P2 - downgrading to P3.
Comment 11 Rochelle Raccah 2006-07-12 00:30:36 UTC
Peter, both dependent issues are fixed and as I mentioned to you earlier, I
suspect event notification problems.  Does this belong in the new umbrella issue?
Comment 12 _ pcw 2006-07-12 23:39:00 UTC
If this is J2EE 1.4, I don't think the event umbrella issue is related since
that is JavaEE5 specific.  I'll look into it.
Comment 13 _ pcw 2007-08-25 09:21:19 UTC
Not sure what we are going to do with CMP relation ship events in 6.0 yet.  We may have something in which case this
issue will apply and should be considered.
Comment 14 Vince Kraemer 2007-12-07 16:20:37 UTC
please close this issue if you forgot to earlier.  If this issue is still open,
please change the target milestone to reflect the current commitment.
Comment 15 Rochelle Raccah 2007-12-10 21:16:03 UTC
CMP UI not present in NB 6.  "cmp" in whiteboard can be used to find these issues if we reenable the CMP UI.