Andrus,
> Are you sure this happens on "Save"? I just checked the code, and the dialog is only called when you click "Synch ObjEntity with DbEntity" button. And from there it does the right thing.
I was mostly concentrating on getting my design correct at the time so I am doing my best at recalling the exact sequence. My best recollection is the following:
1. I added a new DbEntity (E1)
2. I added a foreign key (pointing to E1) to two existing entities (E3 & E4.
3. I added the "to one" relationships to each of the to E3 & E4.
4. I then added the reverse relationship (as it seems the CM was requiring)
5. Then I selected the "create ObjEntity" for E1
6. Only after doing all this did I select the "two arrows" to synch the above 3 entities
7. Then I selected "Save".
As a result of the above seven or so steps the dialog window popped up. My recollection (although it is certainly possible I remember incorrectly) is that it asked if I wanted to remove the foreign keys and the box was checked. So I *remember* that I selected "continue", but since the wording was a tad ambiguous (and since I have never seen this dialog before) I may have indeed deselected the checkbox and then selected "continue".
As a result CM was non-responsive for about 3-4 min and then reported an out of memory exception.
However, even if I did do this the first time, I tried it again and definitely did not de-select the checkbox and selected continue. It became non-responsive again and generated the same out of memory exception.
> Also I couldn't reproduce the memory problem. The only retained object in this operation is the undo stack, which is limited to 100 undo's (which does take memory, but a reasonable amount).
As I reported recently, I performed the same actions (as outlined above) and selected continue and there was no hint of a problem. (Which both suggests that the CM is operating with a sufficient memory configuration, and that the problem may be related to something else).
It is possible (due to my attempting to recall all of my actions in order) that I *may* not have executed step 4 (the reverse relationship) in that order. I just can't remember precisely when I did it.
So let me ask:
Is it required by CM for a "to one" relationships to have a reverse relationship (ie. either to-many or to-one)? If so, and I had mistakenly missed this step, could that have triggered this problem when I selected "Save" then "Continue"?
Thanks,
Joe
On Feb 3, 2010, at 3:04 AM, Andrus Adamchik wrote:
> Are you sure this happens on "Save"? I just checked the code, and the dialog is only called when you click "Synch ObjEntity with DbEntity" button. And from there it does the right thing. Also I couldn't reproduce the memory problem. The only retained object in this operation is the undo stack, which is limited to 100 undo's (which does take memory, but a reasonable amount).
>
> So what I suggest now is that we just wait till it happens again, to see if there is a pattern to reproduce it.
>
>> CayenneModeler Info
>> Version: cayenne.version
>> Build Date: cayenne.build.date
>
> Doesn't look like this is coming from a release build of the Modeler.
>
> Andrus
>
> On Feb 1, 2010, at 1:11 AM, Joe Baldwin wrote:
>
>> Tried to save a project with a new Entity (which had a many to one relationship). When I selected "Save" the following panel was displayed:
>>
>> Remove Foreign Keys mapped as object attributes?
>>
>> Not sure what this would accomplish, I selected "Yes", which appears to be the wrong answer because Cayenne Modeler crashed big time. (see auto report below)
>>
>> Joe
>>
>> CayenneModeler Info
>> Version: cayenne.version
>> Build Date: cayenne.build.date
>> Exception:
>> =================================
>> java.lang.OutOfMemoryError: Java heap space
>> at java.util.Collections$UnmodifiableCollection.iterator(Collections.java:1006)
>> at org.apache.cayenne.map.ObjEntity.getAttributeForDbAttribute(ObjEntity.java:845)
>> at org.apache.cayenne.modeler.undo.DbEntitySyncUndoableEdit$MeaningfulFKsUndoableEdit.<init>(DbEntitySyncUndoableEdit.java:96)
>> at org.apache.cayenne.modeler.action.DbEntitySyncAction.synchDbEntity(DbEntitySyncAction.java:95)
>> at org.apache.cayenne.modeler.action.DbEntitySyncAction.performAction(DbEntitySyncAction.java:60)
>> at org.apache.cayenne.modeler.util.CayenneAction.actionPerformed(CayenneAction.java:163)
>> at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028)
>> at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351)
>> at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
>> at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
>> at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
>> at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
>> at java.awt.Component.processMouseEvent(Component.java:6348)
>> at javax.swing.JComponent.processMouseEvent(JComponent.java:3255)
>> at java.awt.Component.processEvent(Component.java:6113)
>> at java.awt.Container.processEvent(Container.java:2085)
>> at java.awt.Component.dispatchEventImpl(Component.java:4714)
>> at java.awt.Container.dispatchEventImpl(Container.java:2143)
>> at java.awt.Component.dispatchEvent(Component.java:4544)
>> at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4618)
>> at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4282)
>> at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4212)
>> at java.awt.Container.dispatchEventImpl(Container.java:2129)
>> at java.awt.Window.dispatchEventImpl(Window.java:2475)
>> at java.awt.Component.dispatchEvent(Component.java:4544)
>> at java.awt.EventQueue.dispatchEvent(EventQueue.java:635)
>> at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
>> at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
>> at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
>> at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
>> at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
>> at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
>>
>>
>>
>>
>
This archive was generated by hypermail 2.0.0 : Thu Feb 04 2010 - 10:39:21 EST