Issue with quickmodel syncing changes made to project explorer

Posts   
 
    
Posts: 27
Joined: 02-Oct-2008
# Posted on: 30-May-2018 21:16:25   

LLBLGen Pro version 5.4. Build 5.4.1

Create a new project and run the following chunk in the quickmodel editor.

Duck
Duck.Id guid *
Hog
Hog.Id guid *
DuckHog
DuckHog.Duck m1 Duck
DuckHog.Hog m1 Hog

You know, to keep track of all of the unholy duck / hog unions. (just a simple reproduceable example)

If the quickmodel editor window is closed, I can delete the newly created relationships from the project explorer.

However, if the quickmodel editor window is still open, I can delete one of the relationships but when I delete the second one, I get the following crash and the relationships become empty spaces in the project explorer and the designer goes into a sit and spin beachball scenario from which the only solution is to close and restart the app. Also, it asks to save when you quit, if you do that, it puts the project file in a state where it can not be loaded again due to an xml parsing error.

Thanks! Timothy

Exception message:

Exception type: ArgumentException SD.LLBLGen.Pro.Gui.Classes.Diagramming.RelationshipLink is not a link contained in graph SD.LLBLGen.Pro.Gui.Classes.Diagramming.ModelViewGroup


LLBLGen Pro version 5.4. Build 5.4.1 -----[Core exception]-------------------- at ILOG.Diagrammer.GraphLayout.GraphLayout.PerformNonRecursiveLayout(Boolean force, Boolean redraw) at ILOG.Diagrammer.GraphLayout.RecursiveLayout.PerformLayout(Boolean force) at ILOG.Diagrammer.GraphicContainer.PerformGraphLayout() at SD.LLBLGen.Pro.Gui.Classes.Diagramming.ModelViewGroup.OnEntityGlyphBoundsChanged(Object sender, EventArgs e) at SD.Tools.BCLExtensions.SystemRelated.EventExtensionMethods.RaiseEvent(EventHandler handler, Object sender) at SD.LLBLGen.Pro.Gui.Controls.Diagramming.EntityGlyph.HandleFieldsListChanged(ListChangedEventArgs e) at System.ComponentModel.ListChangedEventHandler.Invoke(Object sender, ListChangedEventArgs e) at SD.Tools.Algorithmia.GeneralDataStructures.CommandifiedList1.NotifyChange(ListChangedType changeType, Int32 oldIndex, Int32 newIndex) at SD.LLBLGen.Pro.ApplicationCore.EntityModel.FieldList1.NotifyChange(ListChangedType changeType, Int32 oldIndex, Int32 newIndex) at SD.Tools.Algorithmia.Commands.Command1.Do() at SD.Tools.Algorithmia.Commands.CommandQueue.PerformDoRedoCommand(Boolean performRedo) at SD.Tools.Algorithmia.Commands.CommandQueueManager.EnqueueAndRunCommand(CommandBase toEnqueueAndRun) at System.Collections.ObjectModel.Collection1.Remove(T item) at System.EventHandler.Invoke(Object sender, EventArgs e) at SD.Tools.BCLExtensions.SystemRelated.EventExtensionMethods.RaiseEvent(EventHandler handler, Object sender) at SD.LLBLGen.Pro.ApplicationCore.EntityModel.FieldElement.MarkAsDereferencedFromFieldFieldRelationship() at SD.LLBLGen.Pro.ApplicationCore.EntityModel.FieldRelationship.set_FkField(FieldElement value) at SD.LLBLGen.Pro.ApplicationCore.EntityModel.FieldRelationship.MarkAsRemoved() at System.EventHandler.Invoke(Object sender, EventArgs e) at SD.Tools.BCLExtensions.SystemRelated.EventExtensionMethods.RaiseEvent(EventHandler handler, Object sender) at SD.LLBLGen.Pro.ApplicationCore.EntityModel.EntityModelGraph.OnEdgeRemoved(RelationshipEdge edgeRemoved) at SD.Tools.Algorithmia.UtilityClasses.GeneralUtils.PerformSyncedAction(Action toPerform, Object syncRoot, Boolean isSynchronized) at SD.Tools.Algorithmia.Commands.Command1.Do() at SD.Tools.Algorithmia.Commands.CommandQueue.PerformDoRedoCommand(Boolean performRedo) at SD.Tools.Algorithmia.Commands.CommandQueueManager.EnqueueAndRunCommand(CommandBase toEnqueueAndRun) at SD.Tools.Algorithmia.Graphs.GraphBase2.PerformRemoveEdge(TEdge edgeToRemove) at SD.Tools.Algorithmia.Commands.Command1.Do() at SD.Tools.Algorithmia.Commands.CommandQueue.PerformDoRedoCommand(Boolean performRedo) at SD.Tools.Algorithmia.Commands.CommandQueueManager.EnqueueAndRunCommand(CommandBase toEnqueueAndRun) at System.EventHandler.Invoke(Object sender, EventArgs e) at SD.Tools.BCLExtensions.SystemRelated.EventExtensionMethods.RaiseEvent(EventHandler handler, Object sender) at SD.LLBLGen.Pro.ApplicationCore.EntityModel.EntityModelGraph.OnEdgeRemoved(RelationshipEdge edgeRemoved) at SD.Tools.Algorithmia.UtilityClasses.GeneralUtils.PerformSyncedAction(Action toPerform, Object syncRoot, Boolean isSynchronized) at SD.Tools.Algorithmia.Commands.Command1.Do() at SD.Tools.Algorithmia.Commands.CommandQueue.PerformDoRedoCommand(Boolean performRedo) at SD.Tools.Algorithmia.Commands.CommandQueueManager.EnqueueAndRunCommand(CommandBase toEnqueueAndRun) at SD.Tools.Algorithmia.Graphs.GraphBase2.PerformRemoveEdge(TEdge edgeToRemove) at SD.Tools.Algorithmia.Commands.Command1.Do() at SD.Tools.Algorithmia.Commands.CommandQueue.PerformDoRedoCommand(Boolean performRedo) at SD.Tools.Algorithmia.Commands.CommandQueueManager.EnqueueAndRunCommand(CommandBase toEnqueueAndRun) at SD.LLBLGen.Pro.Gui.Classes.GuiController.<>c__DisplayClass112_0.<PerformRemoveElementsFromProject>b__24(RelationshipEdge r) at SD.LLBLGen.Pro.Gui.Classes.GuiController.PerformElementsRemovalFromParentElement[TElement](Action1 removalFunc, ICollection1 entries) at SD.Tools.Algorithmia.Commands.Command1.Do() at SD.Tools.Algorithmia.Commands.CommandQueue.PerformDoRedoCommand(Boolean performRedo) at SD.Tools.Algorithmia.Commands.CommandQueueManager.EnqueueAndRunCommand(CommandBase toEnqueueAndRun) at SD.LLBLGen.Pro.Gui.Classes.GuiController.PerformRemoveElementsFromProject(List1 nodesOfElementsToRemove, TagEntry`1 parentEntry) at SD.LLBLGen.Pro.Gui.Controls.ProjectExplorer._mainBarManager_ItemClick(Object sender, ItemClickEventArgs e) at DevExpress.XtraBars.BarItem.OnClick(BarItemLink link) at DevExpress.XtraBars.BarButtonItem.OnClick(BarItemLink link) at DevExpress.XtraBars.ViewInfo.BarSelectionInfo.OnShortcutItemClick(BarItem item, BarShortcut shortcut) at DevExpress.XtraBars.MessageFilter.BarManagerHook.PreFilterMessage(Message& m) at DevExpress.XtraBars.MessageFilter.BarManagerMessageFilter.System.Windows.Forms.IMessageFilter.PreFilterMessage(Message& m)

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 31-May-2018 08:20:55   

Hi Timothy, I reproduced your scenario. We will look into this. Thanks for the feedback,.

David Elizondo | LLBLGen Support Team
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39760
Joined: 17-Aug-2003
# Posted on: 31-May-2018 11:03:34   

Looking into it.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39760
Joined: 17-Aug-2003
# Posted on: 31-May-2018 11:54:38   

It appears to be a timing issue inside ILog. When I step through the code in the debugger (and also inside ILog code (thanks to Rider)) it works OK. The edge is removed from the graph data structure of ILog but appears not to be for some odd reason to the code that crashes. It's related to the layout btw. I can reproduce it in a normal model view if I disable incremental layout. With incremental layout (which is enabled by default) it doesn't occur.

Looking into how to mitigate this...

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39760
Joined: 17-Aug-2003
# Posted on: 31-May-2018 13:44:02   

It's definitely a bug inside ILog, or something we apparently forget to call. It's very strange, it now happens during debugging as well, so the timing issue I expected earlier isn't the reason this happens.

Strange thing is that it tries to collect the 'connected elements' (to do a layout) from a graph with only vertices (as all edges have been removed) and all of a sudden the connected elements contain a subgraph with the edge that was already removed. frowning

(and this causes the problem).

Digging...

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39760
Joined: 17-Aug-2003
# Posted on: 31-May-2018 14:58:37   

The only way to fix this is by removing and adding the same layout again to the graph. You won't see this, but it will fix the problem as it will remove a cached object which the ILog library doesn't update internally.

ILog has been discontinued so we can't ask IBM to fix this for us, but that wouldn't have been quick anyway (if ever) so this is more convenient.

Hotfix builds 5.3.6 and 5.4.1 contain the fix and are now available.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 27
Joined: 02-Oct-2008
# Posted on: 01-Jun-2018 01:39:43   

I'm installing the hotfix now and I'll be back with an update in a bit.

Thanks! Timothy

Otis wrote:

The only way to fix this is by removing and adding the same layout again to the graph. You won't see this, but it will fix the problem as it will remove a cached object which the ILog library doesn't update internally.

ILog has been discontinued so we can't ask IBM to fix this for us, but that wouldn't have been quick anyway (if ever) so this is more convenient.

Hotfix builds 5.3.6 and 5.4.1 contain the fix and are now available.

Posts: 27
Joined: 02-Oct-2008
# Posted on: 04-Jun-2018 06:05:52   

Yep, that fixed it.

Coincidentally, this also fixed the other issue that I noticed since I posted the initial thread.

If you created multiple m:m relationships between the same objects, it would dutifully add them (HogCollectionViaDuckHog and HogCollectionViaDuckHog1) and show two m:m links in the quick model window but when deleting the extra m:m relationship, it would remain in the quick model editor (as a green "many --- many" line), even persisting after closing LLBLGen and reloading the project...but it no longer existed in the project explorer view.

Anyway, maybe removing the layout and rebinding it fixed this as well because I can't reproduce it now.

Thanks! Timothy

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39760
Joined: 17-Aug-2003
# Posted on: 04-Jun-2018 09:11:46   

Glad it's sorted! simple_smile

Frans Bouma | Lead developer LLBLGen Pro