Getting error when refreshing database model

Posts   
 
    
Posts: 1255
Joined: 10-Mar-2006
# Posted on: 01-Mar-2014 18:59:50   

Open existing 3.5 project, refresh catalog and everything works fine. Open that same project in 4.1 and get the exception below. (So, no changes were made to catalog as I try to refresh after just having refreshed from 3.5) I noticed there were several people with this exception in prior versions, so I suspect something similar - or one of your changes to how this code works did not make it to 4.1. Is there something in the model that I should look for?

Exception information.

LLBLGen Pro version: v4.1. Build: November 26th, 2013

Exception details:

Message: Object reference not set to an instance of an object. Source: SD.LLBLGen.Pro.ApplicationCore Stack trace: at SD.LLBLGen.Pro.ApplicationCore.ProjectClasses.Project.MigrateRelationshipsAndUniqueConstraints(String driverID, UserConfiguration preferences, IEnumerable1 populatedCatalogs, Dictionary2 beforeRefreshRelationshipsToMetaDataElements, LogNode parentLogNode) at SD.LLBLGen.Pro.ApplicationCore.MetaData.DatabaseMetaData.RefreshMetaData(IEnumerable1 populatedCatalogs, LogNode refreshLogNode, Project containingProject, UserConfiguration preferences) at SD.LLBLGen.Pro.ApplicationCore.MetaData.MetaDataStore.RefreshMetaData(String driverID, IEnumerable1 populatedCatalogs, Project containingProject, UserConfiguration preferences) at SD.LLBLGen.Pro.ApplicationCore.ProjectClasses.Project.RefreshMetaData(String driverID, List`1 populatedCatalogs, UserConfiguration preferences) at SD.LLBLGen.Pro.Gui.Classes.GuiController.PerformRefreshMetaDataAction(String driverID) at SD.LLBLGen.Pro.Gui.Controls.CatalogExplorer._commandManager_CommandClick(Object sender, CommandEventArgs e) at Janus.Windows.UI.Internal.JNSAU.OnMouseUp(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at Janus.Windows.UI.Internal.JNSAU.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Inner exception: <null>

Posts: 1255
Joined: 10-Mar-2006
# Posted on: 01-Mar-2014 19:06:21   

Realized I did not have the latest designer installed....so I did and that did not seem to matter (did not think it would a nothing in release notes)..

Exception information.

LLBLGen Pro version: v4.1. Build: January 16th, 2014

Exception details:

Message: Object reference not set to an instance of an object. Source: SD.LLBLGen.Pro.ApplicationCore Stack trace: at SD.LLBLGen.Pro.ApplicationCore.ProjectClasses.Project.MigrateRelationshipsAndUniqueConstraints(String driverID, UserConfiguration preferences, IEnumerable1 populatedCatalogs, Dictionary2 beforeRefreshRelationshipsToMetaDataElements, LogNode parentLogNode) at SD.LLBLGen.Pro.ApplicationCore.MetaData.DatabaseMetaData.RefreshMetaData(IEnumerable1 populatedCatalogs, LogNode refreshLogNode, Project containingProject, UserConfiguration preferences) at SD.LLBLGen.Pro.ApplicationCore.MetaData.MetaDataStore.RefreshMetaData(String driverID, IEnumerable1 populatedCatalogs, Project containingProject, UserConfiguration preferences) at SD.LLBLGen.Pro.ApplicationCore.ProjectClasses.Project.RefreshMetaData(String driverID, List`1 populatedCatalogs, UserConfiguration preferences) at SD.LLBLGen.Pro.Gui.Classes.GuiController.PerformRefreshMetaDataAction(String driverID) at SD.LLBLGen.Pro.Gui.Controls.CatalogExplorer._commandManager_CommandClick(Object sender, CommandEventArgs e) at Janus.Windows.UI.Internal.JNSAU.OnMouseUp(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at Janus.Windows.UI.Internal.JNSAU.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Inner exception: <null>

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 02-Mar-2014 10:51:25   

I've attached the .pdb of the applicationcore assembly so line numbers are present in the exception. Could you place this pdb in the llblgen pro folder and retry, so we get a line number where the exception took place? Removed. Didn't work

Frans Bouma | Lead developer LLBLGen Pro
Posts: 1255
Joined: 10-Mar-2006
# Posted on: 03-Mar-2014 01:58:22   

I 'unblocked' the file. I put it in my "program files (x86)/solutions design/llblgen pro v4.1" folder. I ran it, got exception, no line numbers. I then ran it as admin, got exception, no line numbers.

Am I missing something here? Screenshot attached.

Attachments
Filename File size Added on Approval
Capture.PNG 43,024 03-Mar-2014 01:58.36 Approved
daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 03-Mar-2014 05:30:07   

WayneBrantley wrote:

I put it in my "program files (x86)/solutions design/llblgen pro v4.1" folder. I ran it, got exception, no line numbers. I then ran it as admin, got exception, no line numbers.

I think it should work. Do you mind opening a HelpDesk thread (private) and attach your .llblgenproj file?

David Elizondo | LLBLGen Support Team
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 03-Mar-2014 10:26:17   

It should work indeed, but just in case, I have added a debug build of applicationcore with pdb. Please overwrite BOTH files, the pdb I attached earlier is not usable with this debug build, use the two files in the zip attached to this post.

outdated, removed.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 1255
Joined: 10-Mar-2006
# Posted on: 03-Mar-2014 14:40:44   

That worked:

Exception information.

LLBLGen Pro version: v4.1. Build: January 16th, 2014

Exception details:

Message: Object reference not set to an instance of an object. Source: SD.LLBLGen.Pro.ApplicationCore Stack trace: at SD.LLBLGen.Pro.ApplicationCore.ProjectClasses.Project.MigrateRelationshipsAndUniqueConstraints(String driverID, UserConfiguration preferences, IEnumerable1 populatedCatalogs, Dictionary2 beforeRefreshRelationshipsToMetaDataElements, LogNode parentLogNode) in c:\Myprojects\VS.NET Projects\LLBLGen Pro v4.1\Designer 4.1\ApplicationCore\ProjectClasses\Project.cs:line 4743 at SD.LLBLGen.Pro.ApplicationCore.MetaData.DatabaseMetaData.RefreshMetaData(IEnumerable1 populatedCatalogs, LogNode refreshLogNode, Project containingProject, UserConfiguration preferences) in c:\Myprojects\VS.NET Projects\LLBLGen Pro v4.1\Designer 4.1\ApplicationCore\MetaData\DatabaseMetaData.cs:line 470 at SD.LLBLGen.Pro.ApplicationCore.MetaData.MetaDataStore.RefreshMetaData(String driverID, IEnumerable1 populatedCatalogs, Project containingProject, UserConfiguration preferences) in c:\Myprojects\VS.NET Projects\LLBLGen Pro v4.1\Designer 4.1\ApplicationCore\MetaData\MetaDataStore.cs:line 239 at SD.LLBLGen.Pro.ApplicationCore.ProjectClasses.Project.RefreshMetaData(String driverID, List`1 populatedCatalogs, UserConfiguration preferences) in c:\Myprojects\VS.NET Projects\LLBLGen Pro v4.1\Designer 4.1\ApplicationCore\ProjectClasses\Project.cs:line 1224 at SD.LLBLGen.Pro.Gui.Classes.GuiController.PerformRefreshMetaDataAction(String driverID) at SD.LLBLGen.Pro.Gui.Controls.CatalogExplorer._commandManager_CommandClick(Object sender, CommandEventArgs e) at Janus.Windows.UI.Internal.JNSAU.OnMouseUp(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at Janus.Windows.UI.Internal.JNSAU.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Inner exception: <null>

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 03-Mar-2014 15:29:14   

It seems this can only happen if a relationship lost its backing FK. It didn't happen in v3, as the error happens in cascade rule checks. They don't anticipate on a null for the FK. I'll correct this and will upload a new debug build for you to test.

(edit) It likely occurs in the situation where an FK + UC are present, and now only the UC is present, the FK is removed. Is that correct?

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 03-Mar-2014 15:33:19   

Please use the attached applicationcore assemblies to see whether the issue has been fixed. You have to refresh the catalog to hit the code which bugged. If it doesn't fix it, please let me know.

Outdated.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 1255
Joined: 10-Mar-2006
# Posted on: 03-Mar-2014 15:37:28   

Yes, that fixed it. Am I all set?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 03-Mar-2014 15:50:10   

I indeed could reproduce it with that scenario: FK+UC forming 1:1 relationship, UC is kept, FK is dropped, refresh, crash. flushed

It's not fixed in full though. Some changes are pending which isn't correct, and it doesn't pick up the UC.

(edit). My bad. I kept the relationship due to settings, Testing the final bits, please hold on a moment.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 03-Mar-2014 15:58:52   

There's still a bug. The relationship in the model isn't removed, while the UC isn't added as a UC to the entity.

Looking into this.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 03-Mar-2014 16:07:06   

NOW it's fixed. The original issue was somewhere else: if an FK+UC combination lost its FK, it was still marked as a target for an existing model relationship which caused a problem as the FK value was null. As the FK was gone, there's no relationship backing anymore so the relationship should be removed. It now does so, and also re-adds the UC to the entity. The fix I added to the code where the crash happens is then no longer necessary.

I attached a release build for you.

Attachments
Filename File size Added on Approval
SD.LLBLGen.Pro.ApplicationCore_release.zip 343,356 03-Mar-2014 16:07.12 Approved
Frans Bouma | Lead developer LLBLGen Pro
Posts: 1255
Joined: 10-Mar-2006
# Posted on: 03-Mar-2014 16:12:52   

Yes, it works and thanks again.