| Author |
Share Topic Topic Search Topic Options
|
hueha
Newbie
Joined: 23-Jul-2010
Posts: 38
|
Post Options
Quote Reply
Topic: SaveChangesAsync with unchanged items returned status of wascancelled=true 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?
|
 |
sbelini
IdeaBlade
Joined: 13-Aug-2010
Location: Oakland
Posts: 786
|
Post Options
Quote Reply
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.
|
 |
smi-mark
DevForce MVP
Joined: 24-Feb-2009
Location: Dallas, Texas
Posts: 343
|
Post Options
Quote Reply
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?
|
 |
hueha
Newbie
Joined: 23-Jul-2010
Posts: 38
|
Post Options
Quote Reply
Posted: 04-Apr-2011 at 9:07pm |
No exception No error
Looks like something is automatically cancelling the query.
|
 |
hueha
Newbie
Joined: 23-Jul-2010
Posts: 38
|
Post Options
Quote Reply
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.
|
 |
midnit
Senior Member
Joined: 22-Jun-2009
Location: Charlotte
Posts: 112
|
Post Options
Quote Reply
Posted: 11-Apr-2011 at 4:23am |
Which overload of the SaveChangesAsync are you using?
|
 |
hueha
Newbie
Joined: 23-Jul-2010
Posts: 38
|
Post Options
Quote Reply
Posted: 11-Apr-2011 at 5:02am |
mgr.SaveChangesAsync(items, null, (opResult) => { Repository.ProcessSaveOpResult(opResult, onOK, onCancel); } , null);
|
 |
midnit
Senior Member
Joined: 22-Jun-2009
Location: Charlotte
Posts: 112
|
Post Options
Quote Reply
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.
Edited by midnit - 11-Apr-2011 at 5:30am
|
 |