Print Page | Close Window

EntitySaveOperation.Cancelled is true

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2449
Printed Date: 18-Oct-2025 at 9:53am


Topic: EntitySaveOperation.Cancelled is true
Posted By: danjal
Subject: EntitySaveOperation.Cancelled is true
Date Posted: 18-Jan-2011 at 4:05am

I have an entity of type Theme and another entity of type User.

My theme entity has a list of users that have access to this theme.

 

I add a new user to have access to a theme like this:

 

p_currentTheme.p_usersWithAccess.Add(newValue);

p_currentTheme.EntityAspect.SetModified();

 

This works fine in cache, but when saving the changes to the database, I see that EntitySaveOperation.Cancelled gets set to true. Is there any way to debug this further to see what is actually wrong?

 




Replies:
Posted By: smi-mark
Date Posted: 18-Jan-2011 at 9:21am
How is newValue being instantiated? You certainly don't want to be calling "SetModified" are you adding this new user to the entity manager cache?


Posted By: sbelini
Date Posted: 18-Jan-2011 at 4:10pm
Hi danjal,
 
Why are you setting p_currentTheme to modified? (There is no need to do that)
 
When you add/remove a child_entity to/from a parent_entity's navigation property, the parent_entity's state remains Unchanged and only the child_entity's state is set to Modified (or remains/is set to Added, if the child_entity is a new entity)
 
 
sbelini


Posted By: danjal
Date Posted: 19-Jan-2011 at 2:32am

We found something interesting yesterday!

I do not know if this is a DevForce issue or a Informix database issue.

 

We have experienced huge problems when adding/removing child entities to/from a parent entity´s navigation property and subsequently saving to the database.

 

The interesting bit that we have found is that this problems can have something to do with the fact that if the parent entity has fields that are set to Nullable = false and that these fields are empty when we save, the save operation gets cancelled without any error or exception – in some cases we are only interested in updating the parent navigation property.

Does anyone have any input one this?

 

Setting the parent entity to SetModified is my attempt to hammer at everything to gets things working/response J sorry.



Posted By: sbelini
Date Posted: 20-Jan-2011 at 5:01pm
Hi danjal,
 
I'm working on getting informix working with VS2010/DevForce2010.
 
Once I get this working, I will run some tests and figure out what's going on.
 
It's still unclear to me why you are using SetModified. What do you mean by "get things working/response"?


Posted By: sbelini
Date Posted: 20-Mar-2011 at 10:16pm
I was not able to reproduce this issue.
I tried adding/deleting orders from employees and or customers but had no issues.
I created a model similar to NorthwindIB (the difference is that CustomerID is Serial instead of Guid) to test it.
Can you provide a test case reproducing the problem?
Silvio.



Print Page | Close Window