New Posts New Posts RSS Feed: SaveChangesAsync with unchanged items returned status of wascancelled=true
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

SaveChangesAsync with unchanged items returned status of wascancelled=true

 Post Reply Post Reply
Author
hueha View Drop Down
Newbie
Newbie


Joined: 23-Jul-2010
Posts: 38
Post Options Post Options   Quote hueha Quote  Post ReplyReply Direct Link To This Post 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?


Back to Top
sbelini View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 13-Aug-2010
Location: Oakland
Posts: 786
Post Options Post Options   Quote sbelini Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
smi-mark View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 24-Feb-2009
Location: Dallas, Texas
Posts: 343
Post Options Post Options   Quote smi-mark Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
hueha View Drop Down
Newbie
Newbie


Joined: 23-Jul-2010
Posts: 38
Post Options Post Options   Quote hueha Quote  Post ReplyReply Direct Link To This Post Posted: 04-Apr-2011 at 9:07pm
No exception 
No error

Looks like something is automatically cancelling the query.

Back to Top
hueha View Drop Down
Newbie
Newbie


Joined: 23-Jul-2010
Posts: 38
Post Options Post Options   Quote hueha Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
midnit View Drop Down
Senior Member
Senior Member
Avatar

Joined: 22-Jun-2009
Location: Charlotte
Posts: 112
Post Options Post Options   Quote midnit Quote  Post ReplyReply Direct Link To This Post Posted: 11-Apr-2011 at 4:23am

Which overload of the SaveChangesAsync are you using?

Back to Top
hueha View Drop Down
Newbie
Newbie


Joined: 23-Jul-2010
Posts: 38
Post Options Post Options   Quote hueha Quote  Post ReplyReply Direct Link To This Post Posted: 11-Apr-2011 at 5:02am
mgr.SaveChangesAsync(items, null,
                (opResult) =>
                {
                    Repository.ProcessSaveOpResult(opResult, onOK, onCancel);
                }
                , null);
Back to Top
midnit View Drop Down
Senior Member
Senior Member
Avatar

Joined: 22-Jun-2009
Location: Charlotte
Posts: 112
Post Options Post Options   Quote midnit Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down