Print Page | Close Window

Error in custom .Create() method

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2009
Forum Discription: For .NET 3.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2208
Printed Date: 28-Apr-2024 at 5:12am


Topic: Error in custom .Create() method
Posted By: sherpedro
Subject: Error in custom .Create() method
Date Posted: 01-Oct-2010 at 11:43am
Hi, i have problems with new entity creation process through .Create() method.
 
Here is the stack trace error i received on the .AddToManager line of code
 
   at IdeaBlade.EntityModel.EntityManager.CheckForPkIdentityProperty(EntityWrapper wrapper)
   at IdeaBlade.EntityModel.EntityManager.AddEntity(Object entity)
   at IdeaBlade.EntityModel.EntityAspect.AddToManager()
   at Qualicode.MayaModel.T_Maya_UserSetting.Create(EntityManager manager, String pBaseRootNameSpace, T_Maya_User poUser) in C:\RepertoireDeTravail\MAYA\Qualicode.DomainModel\T_Maya_UserSetting.cs:line 38
   at Qualicode.Business.WinClient.Model.MayaPortalModel.GetNewUserSetting(T_Maya_User poOwnerUser, String pBaseRootNameSpace) in C:\RepertoireDeTravail\MAYA\Qualicode.Business.WinClient\Model\MayaPortalModel.cs:line 133
   at Qualicode.Business.WinClient.Presenter.MayaEngine.UserSettingManager_NewUserSettingsNeeded(Object sender, NewUserSettingsEventArgs e) in C:\RepertoireDeTravail\MAYA\Qualicode.Business.WinClient\Presenter\MayaEngine.cs:line 1961
   at Qualicode.Core.UserSettingManager.Key(String pNameSpace) in C:\RepertoireDeTravail\MAYA\Qualicode.Core\UserSettingManager.cs:line 82
   at Qualicode.Business.WinClient.View.frmMain.SaveUserSettings(UserSettingManager& poUserSettingManager) in C:\RepertoireDeTravail\MAYA\Qualicode.Business.WinClient\View\frmMain.cs:line 333
   at Qualicode.Business.WinClient.Presenter.MayaEngine._MainForm_FormClosing(Object poSender, FormClosingEventArgs poEventArgs) in C:\RepertoireDeTravail\MAYA\Qualicode.Business.WinClient\Presenter\MayaEngine.cs:line 1932
   at System.Windows.Forms.Form.OnFormClosing(FormClosingEventArgs e)
 
 
I see that the error is raise on the IdeaBlade.EntityModel.EntityManager.CheckForPkIdentityProperty call.
The error i received is "Object reference not set to an instance of an object."
 
Everything was working fine couple of days ago, but now we just can't add new entities. Fetching and updating existing data actually works fine!
 
We're working on a n-tiers architecture with multiple Domain models (different DataSourceKeyName) each with multiple KeyExtensions (allowing lan or wan acces to data).
 
Any help would be great. Thanks.
Pierre
 



Replies:
Posted By: sherpedro
Date Posted: 04-Oct-2010 at 10:41am
ok finally i found the problem...
i was using an entity from a particular entitymanager as an  argument to .Create() method of an entity from a different entitymanager. I was connected through an EntityServer_XXX, so the error returned was not precise enough to find out about the problem. Switch back to local mode for debugging and then the error became more precise.



Print Page | Close Window