New Posts New Posts RSS Feed: Canceling all queries in unit of work
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Canceling all queries in unit of work

 Post Reply Post Reply
Author
mgood View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 18-Nov-2010
Location: Emeryville, CA
Posts: 583
Post Options Post Options   Quote mgood Quote  Post ReplyReply Direct Link To This Post Topic: Canceling all queries in unit of work
    Posted: 16-Apr-2012 at 5:46pm
There isn't a way to cancel all running queries on an EntityManager. In the unit of work, you basically have to keep track of your queries and then for each query you call EntityManager.CancelAsync(userState). Every asynchronous method in DevForce has a signature that lets you specify the userState. For example this could be a sequence number you keep incrementing. The userState also comes back in the corresponding event args of the Completed event, so you can remove an operation from your list once it completes.
Back to Top
JohnBloom View Drop Down
Groupie
Groupie
Avatar

Joined: 30-Nov-2010
Location: Topeka, KS
Posts: 95
Post Options Post Options   Quote JohnBloom Quote  Post ReplyReply Direct Link To This Post Posted: 16-Apr-2012 at 10:06am
We have a process that uses unit of work and can run many serverside tasks at a time. We want the user to be able to click cancel and for that to cancel all of the queries for the unit of work. How should we go about that?
-John Bloom
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down