You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Joe Baldwin <jf...@earthlink.net> on 2010/02/01 00:11:22 UTC

BUG: Cayenne Modeler

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)




Re: BUG: Cayenne Modeler

Posted by Andrus Adamchik <an...@objectstyle.org>.
On Feb 3, 2010, at 10:04 AM, Andrus Adamchik wrote:

>>
>> CayenneModeler Info
>> Version: cayenne.version
>> Build Date: cayenne.build.date
>
> Doesn't look like this is coming from a release build of the Modeler.

I take this back. I just had an unrelated modeler exception in RC2 and  
it also didn't have correct version displayed.

Andrus


Re: BUG: Cayenne Modeler

Posted by Joe Baldwin <jf...@earthlink.net>.
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)
>> 
>> 
>> 
>> 
> 


Re: BUG: Cayenne Modeler

Posted by Andrus Adamchik <an...@objectstyle.org>.
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)
>
>
>
>


Re: BUG: Cayenne Modeler

Posted by Joe Baldwin <jf...@earthlink.net>.
Kevin,

> You need a foreign key in your database table.
> You need a foreign key attribute in your DbEntity.  You also need a
> DbRelationship.
> You do not need a foreign key attribute in your ObjEntity -- you only
> need the (Obj)relationship.

OK. Sorry,  I think I misunderstood one of the previous comments about the ObjEntity.  Yes I have noticed that prior to this, my foreign keys were not mapped directly to ObjEntity attribute but "replaced" with a relationship (I consider this to be normal behavior for an ORM).   However, unless I missed something, this was previously done without the dialog (that showed up this time).

What seems odd (at a use-case level) is that: 1. the dialog asked if I wanted to remove the foreign key from the ObjEntity, and then when the final two cases I simply dismissed the dialog, the foreign keys were not added to the ObjEntity (as I would have expected from prior CM behavior).

In addition, I just performed a test of the intended "to-one" relationship and the ObjEntity relationships are working as expected in my Java classes.

This is why the CM-dialog window is so baffling to me.  I have never seen it before. Dismissing it results in normal behavior (something that seem counter to what the dialog is suggesting). The foreign keys were never mapped as ObjEntity attributes. The final generated code is working fine.

Please let me know what to do next (if you think this is still a open issue).

Thanks,
Joe







On Feb 2, 2010, at 10:22 AM, Mike Kienenberger wrote:

> Hi Joe,
> 
> You need a foreign key in your database table.
> You need a foreign key attribute in your DbEntity.  You also need a
> DbRelationship.
> You do not need a foreign key attribute in your ObjEntity -- you only
> need the (Obj)relationship.
> 
> If any of the above terms are unclear, let me know, and I'll try to
> explain it more in depth.
> 
> On Tue, Feb 2, 2010 at 10:18 AM, Joe Baldwin <jf...@earthlink.net> wrote:
>> Kevin,
>> 
>> I think we might have a communication problem.  First of all let me say that I will follow any instruction the team requests in order to solve this problem.  Cayenne is one of the best pieces of software I have ever used.
>> 
>> Also, I have my own methodology when analyzing a problem.  The first thing I do is establish what steps the user has taken.  Since there are quite a few ways to accomplish the same task in Cayenne Modeler (and especially since I did this one in reverse order), I was hoping to discuss the user procedure first since the dialog window didn't explain much.
>> 
>> So I either have missed some fundamental design step in using CM or I should never have gotten the dialog window in the first place.
>> 
>> Again, I don't want to bother the team with a problem if it is simply user-procedure.  In addition, if I increase the memory and it doesn't crash then I still in a position in which I do not understand why I got this message or what the modeler is doing to my design.
>> 
>> So my first question is: what is the recommended method to create a "to-one" relationship?  If as someone explained that the CM is suggesting, 'I don't need a foreign key' then how does the database keep track of the relationship between the two tables?
>> 
>> Thanks,
>> Joe
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> On Feb 2, 2010, at 9:30 AM, Kevin Menard wrote:
>> 
>>> Hi Joe,
>>> 
>>> Please find comments in-line.
>>> 
>>> 
>>> On Tue, Feb 2, 2010 at 9:09 AM, Joe Baldwin <jf...@earthlink.net> wrote:
>>> 
>>>> The behavior by an app in which it freezes for about 3-4 minutes and then
>>>> generates an out-of-memory-error is typically associated with an infinite
>>>> loop.  Increasing the available memory to an app does nothing to analyze the
>>>> problem.
>>>> 
>>> 
>>> An infinite loop should manifest itself as a stack overflow issue, not an
>>> out of memory one.  I'm not saying it can't happen, but an OOME doesn't mean
>>> that there's an infinite loop.  By your description of the problem, it was a
>>> large model.  So, there are other ways that memory use could explode and we
>>> won't really have a better idea until you try increasing the heap size.
>>> That's simply the nature of the halting problem.
>>> 
>>> 
>>>> 
>>>> It is more likely to be associated the the CM attempting to "remove the
>>>> foreign key" as the CM dialog suggested. If the CM algorithm responsible for
>>>> accomplishing this task is somehow faulty it could have easily resulted in
>>>> an out of memory error.
>>>> 
>>>> If on the other hand there is no error in the algorithm and this task
>>>> requires and extraordinary amount of memory then it still points to the
>>>> assumptions associated with the algorithm and its memory requirements.
>>>> 
>>> 
>>> Certainly.  No one is suggesting to the contrary.  I'm just trying to get
>>> more information to help diagnose the issue.  Without your data model, it's
>>> not something I can easily replicate.
>>> 
>>> 
>>>> 
>>>> Still, it is not clear what the CM-dialog is attempting to accomplish or
>>>> rectify (an associated, we-usually-do-it-this-way would help in these types
>>>> of cases), so either the CM has mis-analysed or the user has made a
>>>> procedural error.  Either way the CM should not go into some functionality
>>>> that takes 3-4 minutes and then runs out of memory.
>>>> 
>>>> In addition, simply dismissing the CM's dialog window with the "remove the
>>>> foreign key?" question results in no out of memory error.  This would not
>>>> typically happen if the CM were operating with insufficient memory.
>>>> 
>>> 
>>> If it is indeed the removing of the foreign key that is causing an OOME, it
>>> still would point at Cayenne operating with insufficient memory.  The
>>> application's memory footprint is not static.
>>> 
>>> 
>>>> 
>>>> Therefore, the facts tend to point towards some exceptional condition that
>>>> should be caught by the CM.  If there is something missing in the user
>>>> configuration then this might be an opportunity to have the CM point this
>>>> out.
>>>> 
>>> 
>>> 
>>> There is no logical entailment from any of the facts that suggest the
>>> problem at this stage.  All we know for certain is you operated on a large
>>> dataset and ran out of memory.  Occam's Razor would suggest you just need
>>> more memory.  Please try bumping the heap size and report and we can get a
>>> better idea.  If it truly is a memory issue, we can investigate reductions
>>> in the allocated memory and provide a different max heap size by default.
>>> 
>>> --
>>> Kevin
>>> 
>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> On Feb 2, 2010, at 6:26 AM, Bryan Lewis wrote:
>>>> 
>>>>> Sure, but you can run the modeler with an increased heap size, like
>>>>> 
>>>>> java.exe -Xmx512m -jar CayenneModeler.jar
>>>>> 
>>>>> 
>>>>> 
>>>>> On Mon, Feb 1, 2010 at 11:25 PM, Joe Baldwin <jfbaldwin@earthlink.net
>>>>> wrote:
>>>>> 
>>>>>> The CayenneModeler crashed not my app.
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> On Feb 1, 2010, at 11:07 PM, Kevin Menard wrote:
>>>>>> 
>>>>>>> Hi Joe,
>>>>>>> 
>>>>>>> It looks like you would have needed to increased the -Xmx JVM property.
>>>>>> Did
>>>>>>> you actually corrupt any data in the process?  If not, I'd suggest
>>>>>>> re-running with an increased heap value.  Otherwise, please file a JIRA
>>>>>>> issue describing the problem.
>>>>>>> 
>>>>>>> --
>>>>>>> Kevin
>>>>>>> 
>>>>>>> 
>>>>>>> On Sun, Jan 31, 2010 at 6:11 PM, Joe Baldwin <jfbaldwin@earthlink.net
>>>>>>> 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)
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>> 
>>>>>> 
>>>> 
>>>> 
>> 
>> 


Re: BUG: Cayenne Modeler

Posted by Mike Kienenberger <mk...@gmail.com>.
Hi Joe,

You need a foreign key in your database table.
You need a foreign key attribute in your DbEntity.  You also need a
DbRelationship.
You do not need a foreign key attribute in your ObjEntity -- you only
need the (Obj)relationship.

If any of the above terms are unclear, let me know, and I'll try to
explain it more in depth.

On Tue, Feb 2, 2010 at 10:18 AM, Joe Baldwin <jf...@earthlink.net> wrote:
> Kevin,
>
> I think we might have a communication problem.  First of all let me say that I will follow any instruction the team requests in order to solve this problem.  Cayenne is one of the best pieces of software I have ever used.
>
> Also, I have my own methodology when analyzing a problem.  The first thing I do is establish what steps the user has taken.  Since there are quite a few ways to accomplish the same task in Cayenne Modeler (and especially since I did this one in reverse order), I was hoping to discuss the user procedure first since the dialog window didn't explain much.
>
> So I either have missed some fundamental design step in using CM or I should never have gotten the dialog window in the first place.
>
> Again, I don't want to bother the team with a problem if it is simply user-procedure.  In addition, if I increase the memory and it doesn't crash then I still in a position in which I do not understand why I got this message or what the modeler is doing to my design.
>
> So my first question is: what is the recommended method to create a "to-one" relationship?  If as someone explained that the CM is suggesting, 'I don't need a foreign key' then how does the database keep track of the relationship between the two tables?
>
> Thanks,
> Joe
>
>
>
>
>
>
>
> On Feb 2, 2010, at 9:30 AM, Kevin Menard wrote:
>
>> Hi Joe,
>>
>> Please find comments in-line.
>>
>>
>> On Tue, Feb 2, 2010 at 9:09 AM, Joe Baldwin <jf...@earthlink.net> wrote:
>>
>>> The behavior by an app in which it freezes for about 3-4 minutes and then
>>> generates an out-of-memory-error is typically associated with an infinite
>>> loop.  Increasing the available memory to an app does nothing to analyze the
>>> problem.
>>>
>>
>> An infinite loop should manifest itself as a stack overflow issue, not an
>> out of memory one.  I'm not saying it can't happen, but an OOME doesn't mean
>> that there's an infinite loop.  By your description of the problem, it was a
>> large model.  So, there are other ways that memory use could explode and we
>> won't really have a better idea until you try increasing the heap size.
>> That's simply the nature of the halting problem.
>>
>>
>>>
>>> It is more likely to be associated the the CM attempting to "remove the
>>> foreign key" as the CM dialog suggested. If the CM algorithm responsible for
>>> accomplishing this task is somehow faulty it could have easily resulted in
>>> an out of memory error.
>>>
>>> If on the other hand there is no error in the algorithm and this task
>>> requires and extraordinary amount of memory then it still points to the
>>> assumptions associated with the algorithm and its memory requirements.
>>>
>>
>> Certainly.  No one is suggesting to the contrary.  I'm just trying to get
>> more information to help diagnose the issue.  Without your data model, it's
>> not something I can easily replicate.
>>
>>
>>>
>>> Still, it is not clear what the CM-dialog is attempting to accomplish or
>>> rectify (an associated, we-usually-do-it-this-way would help in these types
>>> of cases), so either the CM has mis-analysed or the user has made a
>>> procedural error.  Either way the CM should not go into some functionality
>>> that takes 3-4 minutes and then runs out of memory.
>>>
>>> In addition, simply dismissing the CM's dialog window with the "remove the
>>> foreign key?" question results in no out of memory error.  This would not
>>> typically happen if the CM were operating with insufficient memory.
>>>
>>
>> If it is indeed the removing of the foreign key that is causing an OOME, it
>> still would point at Cayenne operating with insufficient memory.  The
>> application's memory footprint is not static.
>>
>>
>>>
>>> Therefore, the facts tend to point towards some exceptional condition that
>>> should be caught by the CM.  If there is something missing in the user
>>> configuration then this might be an opportunity to have the CM point this
>>> out.
>>>
>>
>>
>> There is no logical entailment from any of the facts that suggest the
>> problem at this stage.  All we know for certain is you operated on a large
>> dataset and ran out of memory.  Occam's Razor would suggest you just need
>> more memory.  Please try bumping the heap size and report and we can get a
>> better idea.  If it truly is a memory issue, we can investigate reductions
>> in the allocated memory and provide a different max heap size by default.
>>
>> --
>> Kevin
>>
>>
>>>
>>>
>>>
>>>
>>> On Feb 2, 2010, at 6:26 AM, Bryan Lewis wrote:
>>>
>>>> Sure, but you can run the modeler with an increased heap size, like
>>>>
>>>> java.exe -Xmx512m -jar CayenneModeler.jar
>>>>
>>>>
>>>>
>>>> On Mon, Feb 1, 2010 at 11:25 PM, Joe Baldwin <jfbaldwin@earthlink.net
>>>> wrote:
>>>>
>>>>> The CayenneModeler crashed not my app.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Feb 1, 2010, at 11:07 PM, Kevin Menard wrote:
>>>>>
>>>>>> Hi Joe,
>>>>>>
>>>>>> It looks like you would have needed to increased the -Xmx JVM property.
>>>>> Did
>>>>>> you actually corrupt any data in the process?  If not, I'd suggest
>>>>>> re-running with an increased heap value.  Otherwise, please file a JIRA
>>>>>> issue describing the problem.
>>>>>>
>>>>>> --
>>>>>> Kevin
>>>>>>
>>>>>>
>>>>>> On Sun, Jan 31, 2010 at 6:11 PM, Joe Baldwin <jfbaldwin@earthlink.net
>>>>>> 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)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>
>>>>>
>>>
>>>
>
>

Re: BUG: Cayenne Modeler

Posted by Joe Baldwin <jf...@earthlink.net>.
Kevin,

I think we might have a communication problem.  First of all let me say that I will follow any instruction the team requests in order to solve this problem.  Cayenne is one of the best pieces of software I have ever used.

Also, I have my own methodology when analyzing a problem.  The first thing I do is establish what steps the user has taken.  Since there are quite a few ways to accomplish the same task in Cayenne Modeler (and especially since I did this one in reverse order), I was hoping to discuss the user procedure first since the dialog window didn't explain much.

So I either have missed some fundamental design step in using CM or I should never have gotten the dialog window in the first place.

Again, I don't want to bother the team with a problem if it is simply user-procedure.  In addition, if I increase the memory and it doesn't crash then I still in a position in which I do not understand why I got this message or what the modeler is doing to my design.

So my first question is: what is the recommended method to create a "to-one" relationship?  If as someone explained that the CM is suggesting, 'I don't need a foreign key' then how does the database keep track of the relationship between the two tables?

Thanks,
Joe







On Feb 2, 2010, at 9:30 AM, Kevin Menard wrote:

> Hi Joe,
> 
> Please find comments in-line.
> 
> 
> On Tue, Feb 2, 2010 at 9:09 AM, Joe Baldwin <jf...@earthlink.net> wrote:
> 
>> The behavior by an app in which it freezes for about 3-4 minutes and then
>> generates an out-of-memory-error is typically associated with an infinite
>> loop.  Increasing the available memory to an app does nothing to analyze the
>> problem.
>> 
> 
> An infinite loop should manifest itself as a stack overflow issue, not an
> out of memory one.  I'm not saying it can't happen, but an OOME doesn't mean
> that there's an infinite loop.  By your description of the problem, it was a
> large model.  So, there are other ways that memory use could explode and we
> won't really have a better idea until you try increasing the heap size.
> That's simply the nature of the halting problem.
> 
> 
>> 
>> It is more likely to be associated the the CM attempting to "remove the
>> foreign key" as the CM dialog suggested. If the CM algorithm responsible for
>> accomplishing this task is somehow faulty it could have easily resulted in
>> an out of memory error.
>> 
>> If on the other hand there is no error in the algorithm and this task
>> requires and extraordinary amount of memory then it still points to the
>> assumptions associated with the algorithm and its memory requirements.
>> 
> 
> Certainly.  No one is suggesting to the contrary.  I'm just trying to get
> more information to help diagnose the issue.  Without your data model, it's
> not something I can easily replicate.
> 
> 
>> 
>> Still, it is not clear what the CM-dialog is attempting to accomplish or
>> rectify (an associated, we-usually-do-it-this-way would help in these types
>> of cases), so either the CM has mis-analysed or the user has made a
>> procedural error.  Either way the CM should not go into some functionality
>> that takes 3-4 minutes and then runs out of memory.
>> 
>> In addition, simply dismissing the CM's dialog window with the "remove the
>> foreign key?" question results in no out of memory error.  This would not
>> typically happen if the CM were operating with insufficient memory.
>> 
> 
> If it is indeed the removing of the foreign key that is causing an OOME, it
> still would point at Cayenne operating with insufficient memory.  The
> application's memory footprint is not static.
> 
> 
>> 
>> Therefore, the facts tend to point towards some exceptional condition that
>> should be caught by the CM.  If there is something missing in the user
>> configuration then this might be an opportunity to have the CM point this
>> out.
>> 
> 
> 
> There is no logical entailment from any of the facts that suggest the
> problem at this stage.  All we know for certain is you operated on a large
> dataset and ran out of memory.  Occam's Razor would suggest you just need
> more memory.  Please try bumping the heap size and report and we can get a
> better idea.  If it truly is a memory issue, we can investigate reductions
> in the allocated memory and provide a different max heap size by default.
> 
> -- 
> Kevin
> 
> 
>> 
>> 
>> 
>> 
>> On Feb 2, 2010, at 6:26 AM, Bryan Lewis wrote:
>> 
>>> Sure, but you can run the modeler with an increased heap size, like
>>> 
>>> java.exe -Xmx512m -jar CayenneModeler.jar
>>> 
>>> 
>>> 
>>> On Mon, Feb 1, 2010 at 11:25 PM, Joe Baldwin <jfbaldwin@earthlink.net
>>> wrote:
>>> 
>>>> The CayenneModeler crashed not my app.
>>>> 
>>>> 
>>>> 
>>>> 
>>>> On Feb 1, 2010, at 11:07 PM, Kevin Menard wrote:
>>>> 
>>>>> Hi Joe,
>>>>> 
>>>>> It looks like you would have needed to increased the -Xmx JVM property.
>>>> Did
>>>>> you actually corrupt any data in the process?  If not, I'd suggest
>>>>> re-running with an increased heap value.  Otherwise, please file a JIRA
>>>>> issue describing the problem.
>>>>> 
>>>>> --
>>>>> Kevin
>>>>> 
>>>>> 
>>>>> On Sun, Jan 31, 2010 at 6:11 PM, Joe Baldwin <jfbaldwin@earthlink.net
>>>>> 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)
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>> 
>>>> 
>> 
>> 


Re: BUG: Cayenne Modeler

Posted by Kevin Menard <ni...@gmail.com>.
Hi Joe,

Please find comments in-line.


On Tue, Feb 2, 2010 at 9:09 AM, Joe Baldwin <jf...@earthlink.net> wrote:

> The behavior by an app in which it freezes for about 3-4 minutes and then
> generates an out-of-memory-error is typically associated with an infinite
> loop.  Increasing the available memory to an app does nothing to analyze the
> problem.
>

An infinite loop should manifest itself as a stack overflow issue, not an
out of memory one.  I'm not saying it can't happen, but an OOME doesn't mean
that there's an infinite loop.  By your description of the problem, it was a
large model.  So, there are other ways that memory use could explode and we
won't really have a better idea until you try increasing the heap size.
 That's simply the nature of the halting problem.


>
> It is more likely to be associated the the CM attempting to "remove the
> foreign key" as the CM dialog suggested. If the CM algorithm responsible for
> accomplishing this task is somehow faulty it could have easily resulted in
> an out of memory error.
>
> If on the other hand there is no error in the algorithm and this task
> requires and extraordinary amount of memory then it still points to the
> assumptions associated with the algorithm and its memory requirements.
>

Certainly.  No one is suggesting to the contrary.  I'm just trying to get
more information to help diagnose the issue.  Without your data model, it's
not something I can easily replicate.


>
> Still, it is not clear what the CM-dialog is attempting to accomplish or
> rectify (an associated, we-usually-do-it-this-way would help in these types
> of cases), so either the CM has mis-analysed or the user has made a
> procedural error.  Either way the CM should not go into some functionality
> that takes 3-4 minutes and then runs out of memory.
>
> In addition, simply dismissing the CM's dialog window with the "remove the
> foreign key?" question results in no out of memory error.  This would not
> typically happen if the CM were operating with insufficient memory.
>

If it is indeed the removing of the foreign key that is causing an OOME, it
still would point at Cayenne operating with insufficient memory.  The
application's memory footprint is not static.


>
> Therefore, the facts tend to point towards some exceptional condition that
> should be caught by the CM.  If there is something missing in the user
> configuration then this might be an opportunity to have the CM point this
> out.
>


There is no logical entailment from any of the facts that suggest the
problem at this stage.  All we know for certain is you operated on a large
dataset and ran out of memory.  Occam's Razor would suggest you just need
more memory.  Please try bumping the heap size and report and we can get a
better idea.  If it truly is a memory issue, we can investigate reductions
in the allocated memory and provide a different max heap size by default.

-- 
Kevin


>
>
>
>
> On Feb 2, 2010, at 6:26 AM, Bryan Lewis wrote:
>
> > Sure, but you can run the modeler with an increased heap size, like
> >
> > java.exe -Xmx512m -jar CayenneModeler.jar
> >
> >
> >
> > On Mon, Feb 1, 2010 at 11:25 PM, Joe Baldwin <jfbaldwin@earthlink.net
> >wrote:
> >
> >> The CayenneModeler crashed not my app.
> >>
> >>
> >>
> >>
> >> On Feb 1, 2010, at 11:07 PM, Kevin Menard wrote:
> >>
> >>> Hi Joe,
> >>>
> >>> It looks like you would have needed to increased the -Xmx JVM property.
> >> Did
> >>> you actually corrupt any data in the process?  If not, I'd suggest
> >>> re-running with an increased heap value.  Otherwise, please file a JIRA
> >>> issue describing the problem.
> >>>
> >>> --
> >>> Kevin
> >>>
> >>>
> >>> On Sun, Jan 31, 2010 at 6:11 PM, Joe Baldwin <jfbaldwin@earthlink.net
> >>> 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)
> >>>>
> >>>>
> >>>>
> >>>>
> >>
> >>
>
>

Re: BUG: Cayenne Modeler

Posted by Joe Baldwin <jf...@earthlink.net>.
Andrus,

One more data point (based on another test):

I just change the "Delete Rule" associated with the three ObjEntities and then tried to save the project.  The dialog popped up:

	Title: Synchrnize ObjEntity with DbEntity
	CheckBox
		value: checked
		Question: Remove Foreign Keys Mapped as Object Attributes.
	Options:
		[Cancel [Continue]

1. I selected "continue" and CM did not freeze or report an exception.

Recommendation:
If I understood the previous discussion from earlier today, wouldn't it be more succinct to say:

	Question: "Add DbEntity Foreign Keys to ObjEntity Attribute List? (Not normally required)" 
	value: unchecked
	Options: [Cancel] [Continue]

because the current question almost sounds as if it is intending to remove the DbEntity attribute (which is why I was confused as to what actions it was going to take).

Joe





On Feb 2, 2010, at 10:40 AM, Andrus Adamchik wrote:

> 
> On Feb 2, 2010, at 4:53 PM, Joe Baldwin wrote:
> 
>> Still, I have created about 15-20 relationships with this same design and have never seen this dialog or this error before.
>> 
>> You are the expert, of course, however if I am to help out by reporting a problem I believe it would be helpful to first establish what I steps I took to precipitate the problem and the determine if it simply a user-procedural error.  In addition, I could have made a mistake, but what the CM has asked to do does not seem logical, so again it I think the initial user-procedure is a good place to start.  (I can increase memory all day long but if I am doing something out of order then it won't help the analysis.)
> 
> I second Mike's explanation of why this dialog is there.
> 
> But...  I just tried reproducing that with RC1 and I can't even cause this dialog to appear, no matter whether I have meaningful FK or not. So something is wrong somewhere in the Modeler. Also in OS X assembly the default -Xmx500m that should be more than enough for any kind of projects.
> 
> Investigating...
> 
> Andrus
> 


Re: BUG: Cayenne Modeler

Posted by Andrus Adamchik <an...@objectstyle.org>.
On Feb 2, 2010, at 4:53 PM, Joe Baldwin wrote:

> Still, I have created about 15-20 relationships with this same  
> design and have never seen this dialog or this error before.
>
> You are the expert, of course, however if I am to help out by  
> reporting a problem I believe it would be helpful to first establish  
> what I steps I took to precipitate the problem and the determine if  
> it simply a user-procedural error.  In addition, I could have made a  
> mistake, but what the CM has asked to do does not seem logical, so  
> again it I think the initial user-procedure is a good place to  
> start.  (I can increase memory all day long but if I am doing  
> something out of order then it won't help the analysis.)

I second Mike's explanation of why this dialog is there.

But...  I just tried reproducing that with RC1 and I can't even cause  
this dialog to appear, no matter whether I have meaningful FK or not.  
So something is wrong somewhere in the Modeler. Also in OS X assembly  
the default -Xmx500m that should be more than enough for any kind of  
projects.

Investigating...

Andrus


Re: BUG: Cayenne Modeler

Posted by Joe Baldwin <jf...@earthlink.net>.
Andrus,

Here is the info that your requested:

> * Which version of the Modeler are you using?

3.0RC1, Application (Universal),  Java Hotspot 64 bit server VM 1.6.0_17 on Mac OS 10.6.2

> * Are you using a platform-specific build provided by Cayenne, or are you running it yourself with java?


It appears to be a universal app compiled for OSX.  (Sorry, I have never written a native app for OSX so I couldn't find more info than this.)

> An OutOfMemoryError can be associated with many kinds of conditions.

Yes, I am aware of this.  When I first reported this I started by explaining that it could have been associated with a misunderstanding on my part about the steps I took to precipitate this (i.e. I could have made bad assumptions about the order in which I created these relationships,  This could have easily caused an exceptional condition.)

Still, I have created about 15-20 relationships with this same design and have never seen this dialog or this error before.

You are the expert, of course, however if I am to help out by reporting a problem I believe it would be helpful to first establish what I steps I took to precipitate the problem and the determine if it simply a user-procedural error.  In addition, I could have made a mistake, but what the CM has asked to do does not seem logical, so again it I think the initial user-procedure is a good place to start.  (I can increase memory all day long but if I am doing something out of order then it won't help the analysis.)

I will be happy to help with this, but I don't want to waste your time with a bug report if I simply did something out of order.

Joe



On Feb 2, 2010, at 9:28 AM, Andrus Adamchik wrote:

> Hi Joe,
> 
> (Disclaimer: I also haven't looked at the code involved yet).
> 
> An OutOfMemoryError can be associated with many kinds of conditions. You can have an infinite loop not causing an OutOfMemory. And also OutOfMemoryError is by itself often causing a UI freeze, as the JVM tries to free up some memory before the full app crash. So don't jump to conclusions just yet.
> 
>> Increasing the available memory to an app does nothing to analyze the problem.
> 
> Have you tried it though? After all there is some minimal amount of heap space required for the Modeler to run, even when it is bug free (which I am not claiming it is).
> 
> If that doesn't help, could you provide this info please (sorry if I missed it and it was mentioned already) :
> 
> * Which version of the Modeler are you using?
> * Are you using a platform-specific build provided by Cayenne, or are you running it yourself with java?
> 
> Andrus
> 
> 
> 
> On Feb 2, 2010, at 4:09 PM, Joe Baldwin wrote:
>> The behavior by an app in which it freezes for about 3-4 minutes and then generates an out-of-memory-error is typically associated with an infinite loop.  Increasing the available memory to an app does nothing to analyze the problem.
>> 
>> It is more likely to be associated the the CM attempting to "remove the foreign key" as the CM dialog suggested. If the CM algorithm responsible for accomplishing this task is somehow faulty it could have easily resulted in an out of memory error.
>> 
>> If on the other hand there is no error in the algorithm and this task requires and extraordinary amount of memory then it still points to the assumptions associated with the algorithm and its memory requirements.
>> 
>> Still, it is not clear what the CM-dialog is attempting to accomplish or rectify (an associated, we-usually-do-it-this-way would help in these types of cases), so either the CM has mis-analysed or the user has made a procedural error.  Either way the CM should not go into some functionality that takes 3-4 minutes and then runs out of memory.
>> 
>> In addition, simply dismissing the CM's dialog window with the "remove the foreign key?" question results in no out of memory error.  This would not typically happen if the CM were operating with insufficient memory.
>> 
>> Therefore, the facts tend to point towards some exceptional condition that should be caught by the CM.  If there is something missing in the user configuration then this might be an opportunity to have the CM point this out.
>> 
>> 
>> 
>> 
>> On Feb 2, 2010, at 6:26 AM, Bryan Lewis wrote:
>> 
>>> Sure, but you can run the modeler with an increased heap size, like
>>> 
>>> java.exe -Xmx512m -jar CayenneModeler.jar
>>> 
>>> 
>>> 
>>> On Mon, Feb 1, 2010 at 11:25 PM, Joe Baldwin <jf...@earthlink.net>wrote:
>>> 
>>>> The CayenneModeler crashed not my app.
>>>> 
>>>> 
>>>> 
>>>> 
>>>> On Feb 1, 2010, at 11:07 PM, Kevin Menard wrote:
>>>> 
>>>>> Hi Joe,
>>>>> 
>>>>> It looks like you would have needed to increased the -Xmx JVM property.
>>>> Did
>>>>> you actually corrupt any data in the process?  If not, I'd suggest
>>>>> re-running with an increased heap value.  Otherwise, please file a JIRA
>>>>> issue describing the problem.
>>>>> 
>>>>> --
>>>>> Kevin
>>>>> 
>>>>> 
>>>>> On Sun, Jan 31, 2010 at 6:11 PM, Joe Baldwin <jfbaldwin@earthlink.net
>>>>> 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)
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>> 
>>>> 
>> 
>> 
> 


Re: BUG: Cayenne Modeler

Posted by Andrus Adamchik <an...@objectstyle.org>.
Hi Joe,

(Disclaimer: I also haven't looked at the code involved yet).

An OutOfMemoryError can be associated with many kinds of conditions.  
You can have an infinite loop not causing an OutOfMemory. And also  
OutOfMemoryError is by itself often causing a UI freeze, as the JVM  
tries to free up some memory before the full app crash. So don't jump  
to conclusions just yet.

> Increasing the available memory to an app does nothing to analyze  
> the problem.

Have you tried it though? After all there is some minimal amount of  
heap space required for the Modeler to run, even when it is bug free  
(which I am not claiming it is).

If that doesn't help, could you provide this info please (sorry if I  
missed it and it was mentioned already) :

* Which version of the Modeler are you using?
* Are you using a platform-specific build provided by Cayenne, or are  
you running it yourself with java?

Andrus



On Feb 2, 2010, at 4:09 PM, Joe Baldwin wrote:
> The behavior by an app in which it freezes for about 3-4 minutes and  
> then generates an out-of-memory-error is typically associated with  
> an infinite loop.  Increasing the available memory to an app does  
> nothing to analyze the problem.
>
> It is more likely to be associated the the CM attempting to "remove  
> the foreign key" as the CM dialog suggested. If the CM algorithm  
> responsible for accomplishing this task is somehow faulty it could  
> have easily resulted in an out of memory error.
>
> If on the other hand there is no error in the algorithm and this  
> task requires and extraordinary amount of memory then it still  
> points to the assumptions associated with the algorithm and its  
> memory requirements.
>
> Still, it is not clear what the CM-dialog is attempting to  
> accomplish or rectify (an associated, we-usually-do-it-this-way  
> would help in these types of cases), so either the CM has mis- 
> analysed or the user has made a procedural error.  Either way the CM  
> should not go into some functionality that takes 3-4 minutes and  
> then runs out of memory.
>
> In addition, simply dismissing the CM's dialog window with the  
> "remove the foreign key?" question results in no out of memory  
> error.  This would not typically happen if the CM were operating  
> with insufficient memory.
>
> Therefore, the facts tend to point towards some exceptional  
> condition that should be caught by the CM.  If there is something  
> missing in the user configuration then this might be an opportunity  
> to have the CM point this out.
>
>
>
>
> On Feb 2, 2010, at 6:26 AM, Bryan Lewis wrote:
>
>> Sure, but you can run the modeler with an increased heap size, like
>>
>> java.exe -Xmx512m -jar CayenneModeler.jar
>>
>>
>>
>> On Mon, Feb 1, 2010 at 11:25 PM, Joe Baldwin  
>> <jf...@earthlink.net>wrote:
>>
>>> The CayenneModeler crashed not my app.
>>>
>>>
>>>
>>>
>>> On Feb 1, 2010, at 11:07 PM, Kevin Menard wrote:
>>>
>>>> Hi Joe,
>>>>
>>>> It looks like you would have needed to increased the -Xmx JVM  
>>>> property.
>>> Did
>>>> you actually corrupt any data in the process?  If not, I'd suggest
>>>> re-running with an increased heap value.  Otherwise, please file  
>>>> a JIRA
>>>> issue describing the problem.
>>>>
>>>> --
>>>> Kevin
>>>>
>>>>
>>>> On Sun, Jan 31, 2010 at 6:11 PM, Joe Baldwin <jfbaldwin@earthlink.net
>>>> 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)
>>>>>
>>>>>
>>>>>
>>>>>
>>>
>>>
>
>


Re: BUG: Cayenne Modeler

Posted by Joe Baldwin <jf...@earthlink.net>.
The behavior by an app in which it freezes for about 3-4 minutes and then generates an out-of-memory-error is typically associated with an infinite loop.  Increasing the available memory to an app does nothing to analyze the problem.

It is more likely to be associated the the CM attempting to "remove the foreign key" as the CM dialog suggested. If the CM algorithm responsible for accomplishing this task is somehow faulty it could have easily resulted in an out of memory error.

If on the other hand there is no error in the algorithm and this task requires and extraordinary amount of memory then it still points to the assumptions associated with the algorithm and its memory requirements.

Still, it is not clear what the CM-dialog is attempting to accomplish or rectify (an associated, we-usually-do-it-this-way would help in these types of cases), so either the CM has mis-analysed or the user has made a procedural error.  Either way the CM should not go into some functionality that takes 3-4 minutes and then runs out of memory.

In addition, simply dismissing the CM's dialog window with the "remove the foreign key?" question results in no out of memory error.  This would not typically happen if the CM were operating with insufficient memory.

Therefore, the facts tend to point towards some exceptional condition that should be caught by the CM.  If there is something missing in the user configuration then this might be an opportunity to have the CM point this out.




On Feb 2, 2010, at 6:26 AM, Bryan Lewis wrote:

> Sure, but you can run the modeler with an increased heap size, like
> 
> java.exe -Xmx512m -jar CayenneModeler.jar
> 
> 
> 
> On Mon, Feb 1, 2010 at 11:25 PM, Joe Baldwin <jf...@earthlink.net>wrote:
> 
>> The CayenneModeler crashed not my app.
>> 
>> 
>> 
>> 
>> On Feb 1, 2010, at 11:07 PM, Kevin Menard wrote:
>> 
>>> Hi Joe,
>>> 
>>> It looks like you would have needed to increased the -Xmx JVM property.
>> Did
>>> you actually corrupt any data in the process?  If not, I'd suggest
>>> re-running with an increased heap value.  Otherwise, please file a JIRA
>>> issue describing the problem.
>>> 
>>> --
>>> Kevin
>>> 
>>> 
>>> On Sun, Jan 31, 2010 at 6:11 PM, Joe Baldwin <jfbaldwin@earthlink.net
>>> 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)
>>>> 
>>>> 
>>>> 
>>>> 
>> 
>> 


Re: BUG: Cayenne Modeler

Posted by Bryan Lewis <jb...@gmail.com>.
Sure, but you can run the modeler with an increased heap size, like

java.exe -Xmx512m -jar CayenneModeler.jar



On Mon, Feb 1, 2010 at 11:25 PM, Joe Baldwin <jf...@earthlink.net>wrote:

> The CayenneModeler crashed not my app.
>
>
>
>
> On Feb 1, 2010, at 11:07 PM, Kevin Menard wrote:
>
> > Hi Joe,
> >
> > It looks like you would have needed to increased the -Xmx JVM property.
>  Did
> > you actually corrupt any data in the process?  If not, I'd suggest
> > re-running with an increased heap value.  Otherwise, please file a JIRA
> > issue describing the problem.
> >
> > --
> > Kevin
> >
> >
> > On Sun, Jan 31, 2010 at 6:11 PM, Joe Baldwin <jfbaldwin@earthlink.net
> >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)
> >>
> >>
> >>
> >>
>
>

Re: BUG: Cayenne Modeler

Posted by Joe Baldwin <jf...@earthlink.net>.
The CayenneModeler crashed not my app.




On Feb 1, 2010, at 11:07 PM, Kevin Menard wrote:

> Hi Joe,
> 
> It looks like you would have needed to increased the -Xmx JVM property.  Did
> you actually corrupt any data in the process?  If not, I'd suggest
> re-running with an increased heap value.  Otherwise, please file a JIRA
> issue describing the problem.
> 
> -- 
> Kevin
> 
> 
> On Sun, Jan 31, 2010 at 6:11 PM, Joe Baldwin <jf...@earthlink.net>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)
>> 
>> 
>> 
>> 


Re: BUG: Cayenne Modeler

Posted by Kevin Menard <ni...@gmail.com>.
Hi Joe,

It looks like you would have needed to increased the -Xmx JVM property.  Did
you actually corrupt any data in the process?  If not, I'd suggest
re-running with an increased heap value.  Otherwise, please file a JIRA
issue describing the problem.

-- 
Kevin


On Sun, Jan 31, 2010 at 6:11 PM, Joe Baldwin <jf...@earthlink.net>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)
>
>
>
>

Re: BUG: Cayenne Modeler

Posted by Mike Kienenberger <mk...@gmail.com>.
Again, I'm not using Cayenne in any current project, so it's hard for
me to comment on anything other than concepts right now.

You would want an E1.COMPLEX_TYPE_ID foreign key in your table and in
your DbEntity.

More than likely, you do not want your ObjEntity E1 to have a
"complexTypeId" attribute.   Instead, you want to only have a to-one
"complexType" relationship.   This is what the Modeler is offering to
automatically remove for you.   Apparently, the remove operation has a
bug :)   You can always remove "complexTypeId" manually yourself.

And it probably will not hurt anything if you leave the attribute
there other than leave some unnecessary attributes in the model.

On Mon, Feb 1, 2010 at 12:21 PM, Joe Baldwin <jf...@earthlink.net> wrote:
> Mike,
>
> Thanks, we all probably need to understand this for better Cayenne Modeler designing.  I am still confused by some of your comments ...
>
>> This is a foreign key mapped as an object attribute as opposed to a relationship "toArtist" from painting to artist.
>
>
> I am not sure what the distinction is that you are intending.  I originally added the foreign key as an attribute and (assuming that I am taking the correct steps) am mapping the relationship using Cayenne Modeler.  I have never seen the CayenneModeler warning prior to this.
>
> The only difference in my procedure in this case is the order in which I mapped the relationship.  I have an entity (E1) that requires a classification (aka complex type), and I  implemented that "complex type" definition as another database table (E2).  Therefore from the perspective of E1 there is a "to-one" relationship (i.e. so you can then say: E1 is a type of E2).  For this design, it is not terribly useful to think of the "type" E2 as having a collection of E1's.  *However*, when I define the "to-one" relationship as I describe above, Cayenne modeler auto-magically creates a "to-many" reverse relationship.
>
> Under normal circumstances I typically define the "to-many" relationship first, but not this time.  I was wondering if this could have precipitated the error with CM?
>
> BTW, I did the same steps last night with another Entity and got the same freeze, then crash.  It appears that this condition might be creating an infinite loop (because it takes about 3-4 minutes before the modeler crashes and all functions are frozen during this time).  My work-around to avoiding a crash was to decline CM's offer to "remove the foreign key".
>
> It would be nice to understand a bit more about what CM is assuming so that I can feel more confident about my work-around.
>
> Joe
>
>
>
>
>
>
> On Feb 1, 2010, at 11:29 AM, Mike Kienenberger wrote:
>
>> I won't address the crash, but I can explain what it should mean.
>>
>> Assume you have a column ARTIST_ID in table PAINTING, which is a
>> foreign key to table ARTIST.
>>
>> When the ObjEntity was set up, assume an "artistId" attribute was created.
>>
>> This is a foreign key mapped as an object attribute as opposed to a
>> relationship "toArtist" from painting to artist.
>>
>> Normally you don't need direct access to the foreign key, so the
>> modeler is asking you if you want to get rid of "artistId" and other
>> such attributes.
>>
>> On Sun, Jan 31, 2010 at 6:11 PM, Joe Baldwin <jf...@earthlink.net> 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)
>>>
>>>
>>>
>>>
>
>

Re: BUG: Cayenne Modeler

Posted by Joe Baldwin <jf...@earthlink.net>.
Mike,

Thanks, we all probably need to understand this for better Cayenne Modeler designing.  I am still confused by some of your comments ... 

> This is a foreign key mapped as an object attribute as opposed to a relationship "toArtist" from painting to artist.


I am not sure what the distinction is that you are intending.  I originally added the foreign key as an attribute and (assuming that I am taking the correct steps) am mapping the relationship using Cayenne Modeler.  I have never seen the CayenneModeler warning prior to this.

The only difference in my procedure in this case is the order in which I mapped the relationship.  I have an entity (E1) that requires a classification (aka complex type), and I  implemented that "complex type" definition as another database table (E2).  Therefore from the perspective of E1 there is a "to-one" relationship (i.e. so you can then say: E1 is a type of E2).  For this design, it is not terribly useful to think of the "type" E2 as having a collection of E1's.  *However*, when I define the "to-one" relationship as I describe above, Cayenne modeler auto-magically creates a "to-many" reverse relationship.

Under normal circumstances I typically define the "to-many" relationship first, but not this time.  I was wondering if this could have precipitated the error with CM?

BTW, I did the same steps last night with another Entity and got the same freeze, then crash.  It appears that this condition might be creating an infinite loop (because it takes about 3-4 minutes before the modeler crashes and all functions are frozen during this time).  My work-around to avoiding a crash was to decline CM's offer to "remove the foreign key".

It would be nice to understand a bit more about what CM is assuming so that I can feel more confident about my work-around.

Joe
 





On Feb 1, 2010, at 11:29 AM, Mike Kienenberger wrote:

> I won't address the crash, but I can explain what it should mean.
> 
> Assume you have a column ARTIST_ID in table PAINTING, which is a
> foreign key to table ARTIST.
> 
> When the ObjEntity was set up, assume an "artistId" attribute was created.
> 
> This is a foreign key mapped as an object attribute as opposed to a
> relationship "toArtist" from painting to artist.
> 
> Normally you don't need direct access to the foreign key, so the
> modeler is asking you if you want to get rid of "artistId" and other
> such attributes.
> 
> On Sun, Jan 31, 2010 at 6:11 PM, Joe Baldwin <jf...@earthlink.net> 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)
>> 
>> 
>> 
>> 


Re: BUG: Cayenne Modeler

Posted by Mike Kienenberger <mk...@gmail.com>.
I won't address the crash, but I can explain what it should mean.

Assume you have a column ARTIST_ID in table PAINTING, which is a
foreign key to table ARTIST.

When the ObjEntity was set up, assume an "artistId" attribute was created.

This is a foreign key mapped as an object attribute as opposed to a
relationship "toArtist" from painting to artist.

Normally you don't need direct access to the foreign key, so the
modeler is asking you if you want to get rid of "artistId" and other
such attributes.

On Sun, Jan 31, 2010 at 6:11 PM, Joe Baldwin <jf...@earthlink.net> 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)
>
>
>
>