Exception thrown in designer, possibly when a PK is modified on an existing table

Posts   
 
    
JSobell
User
Posts: 136
Joined: 07-Jan-2006
# Posted on: 03-Mar-2022 00:31:00   

Exception viewer in 5.9.1 shows the below error when a 'Sync Relational Model Data' is performed on a SQL Database after I suspect changing the primary key on a table. Reopening the designer and reloading the project resolved the problem, but lost whatever caused the exception. I have experienced this twice in 5.9.0, so I'd suggest fiddling with existing indexes and PK's on a table is required to find how to reproduce it.

Cheers, Jason

Exception information.
=============================================================
LLBLGen Pro version: v5.9. Build: 5.9.0

Exception details:
=====================
Message: The given key was not present in the dictionary.
Source: mscorlib
Stack trace: 
   at System.ThrowHelper.ThrowKeyNotFoundException()
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at SD.LLBLGen.Pro.Gui.Controls.CatalogExplorer.PerformHighlightNodesOfElements(List`1 targetsToHighlight)
   at SD.LLBLGen.Pro.Gui.Controls.ProjectExplorer.HighlightMappedTargetsOfSelectedElements[T](IEnumerable`1 selectedElements)
   at SD.LLBLGen.Pro.Gui.Controls.ProjectExplorer.HighlightRelatedElementsOfEntities(List`1 selectedEntityTags)
   at SD.LLBLGen.Pro.Gui.Controls.ProjectExplorer.HighlightNodesRelativeElementsOfSelectedNodes()
   at DevExpress.XtraTreeList.TreeList.RaiseSelectionChanged()
   at DevExpress.XtraTreeList.TreeList.OnSelectionChanged()
   at SD.LLBLGen.Pro.Gui.Controls.BetterTreeList.OnSelectionChanged()
   at SD.LLBLGen.Pro.Gui.Controls.ProjectExplorer.ApplyCachedStatesToNode(TreeListNode currentNode)
   at SD.LLBLGen.Pro.Gui.Controls.ProjectExplorer.ApplyCachedStatesToNode(TreeListNode currentNode)
   at SD.LLBLGen.Pro.Gui.Controls.ProjectExplorer.ApplyCachedStatesToNode(TreeListNode currentNode)
   at SD.LLBLGen.Pro.Gui.Controls.ProjectExplorer.ApplyCachedStatesToNode(TreeListNode currentNode)
   at SD.LLBLGen.Pro.Gui.Controls.ProjectExplorer.ApplyCachedStatesToNode(TreeListNode currentNode)
   at SD.LLBLGen.Pro.Gui.Controls.ProjectExplorer.VisualizeProject(Boolean afterLoad)
   at SD.LLBLGen.Pro.Gui.Controls.MainWindow.PerformPostMetaDataRefreshActions()
   at SD.LLBLGen.Pro.Gui.Classes.GuiController.PerformSyncTasks(List`1 tasksToPerform)
   at SD.LLBLGen.Pro.Gui.Controls.MdiTabs.SyncRelationalModelDataTab.PerformTasks()
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at DevExpress.XtraEditors.BaseButton.OnMouseUp(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at DevExpress.Utils.Controls.ControlBase.BaseWndProc(Message& m)
   at DevExpress.XtraEditors.BaseControl.WndProc(Message& msg)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Inner exception: <null>
Otis avatar
Otis
LLBLGen Pro Team
Posts: 38963
Joined: 17-Aug-2003
# Posted on: 03-Mar-2022 09:23:39   

We'll look into it!

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 38963
Joined: 17-Aug-2003
# Posted on: 03-Mar-2022 10:48:30   

It seems to happen when a node in the catalog explorer was highlighted due to a selection in the project explorer, then a sync occurs which changes the target of the selected node in the project explorer and the node of the new element isn't there yet, and this causes the problem, as the highlighting of the catalog explorer arrives before the new meta-data is visualized in the catalog explorer. An easy cop-out solution would be to simply check for the missing node but that would leave the current selected node in the project explorer after the sync not highlighting its proper counterpart.

(We haven't been able to reproduce this in any way btw, but we think in theory it could happen like the situation above)

We'll think of a solution to do this better. Stay tuned.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 38963
Joined: 17-Aug-2003
# Posted on: 03-Mar-2022 11:48:40   

We've implemented extra code to make sure elements are properly highlighted after a sync and no exception should occur anymore. Fixed in v5.9.1 hotfix, now available.

Frans Bouma | Lead developer LLBLGen Pro