Print Page | Close Window

SaveChangesAsync with unchanged items returned status of wascancelled=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=2605
Printed Date: 05-Feb-2026 at 8:33pm


Topic: SaveChangesAsync with unchanged items returned status of wascancelled=true
Posted By: hueha
Subject: SaveChangesAsync with unchanged items returned status of wascancelled=true
Date Posted: 02-Apr-2011 at 7:38am
I'm saving a list of entities which are unchanged (I have a situation where I'm unsure if they made changes so I just do a save anyway).  The IdeaBlade.EntityModel.EntitySaveOperation object that is returned in the callback has a SaveStaus of "Not OK - Cancelled".  I think previously I've had a status of "NoOperation" when nothing was required to save.  Is this a bug?





Replies:
Posted By: sbelini
Date Posted: 04-Apr-2011 at 9:30am
Hi hueha,
 
I can't reproduce the issue here. (my SaveStatus is NoOperation)
 
Please provide a small solution against NorthwindIB reproducing the issue.
 
Silvio.


Posted By: smi-mark
Date Posted: 04-Apr-2011 at 8:46pm
It would probably be worth looking at the debuglog and seeing what that shows, it may give more information.

Also, if you're getting a Not OK, are you seeing any exception in the result args?


Posted By: hueha
Date Posted: 04-Apr-2011 at 9:07pm
No exception 
No error

Looks like something is automatically cancelling the query.



Posted By: hueha
Date Posted: 09-Apr-2011 at 7:31am
Sorry haven't got time to do a demo yet.  I think the problem is this
1. Copy items into a another entity manager.  
2. Call savechangesasync on the items without changing anything.


Posted By: midnit
Date Posted: 11-Apr-2011 at 4:23am

Which overload of the SaveChangesAsync are you using?



Posted By: hueha
Date Posted: 11-Apr-2011 at 5:02am
mgr.SaveChangesAsync(items, null,
                (opResult) =>
                {
                    Repository.ProcessSaveOpResult(opResult, onOK, onCancel);
                }
                , null);


Posted By: midnit
Date Posted: 11-Apr-2011 at 5:29am
Since I use the same overload in our application I just tried it. Normally you can't save in our app until something is changed but that is easy to circumvent.
 
EntityManager.SaveChangesAsync(EntitiesToImport, null, SaveChangesCallback, null);
 
I attempted to save with a list of 25 entities, none of which had changed. In the SaveChangesCallback my SaveResult was {Ok - No Operation}
 
Sorry, I was unable to reproduce. I tested with 6.0.9.



Print Page | Close Window