Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 207355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:43:41+00:00 2026-05-11T17:43:41+00:00

I’ve been working with some ExternalDataExchange – based communication in WF recently. My understanding

  • 0

I’ve been working with some ExternalDataExchange – based communication in WF recently. My understanding is that when working with a long-running (in this case, a State Machine) workflows, communication is queued, durable, and transactional.

I’m using SQL Persistence and a EventArgs that is marked as “WaitForIdle = true”.

I would assume that when I do something like this:

using(TransactionScope scope = new TransactionScope())
{
     IMyEDEService service = wfRuntime.GetService<IMyEDEService>()
     service.MyMethod(wfInstanceGuid, "Here's some data");
     DoSomeDatabaseWork();
} //Dispose causes scope to rollback

I would expect that my event won’t fire on the workflow. It appears to actually be delivered, though, so this leads me to believe this is not transactional. You could see how the data committed to a database in DoSomeDatabaseWork() being rolled back, but the workflow moving foward could be bad.

Can anyone confirm this and if so, do you have a workaround to make the message a transactional one?

Really what I want is one of these two things:

  1. The workflow shouldn’t react to the message I enqueued via external data exchange until the transaction that enqueued the message is committed (much like service broker does in SQL server).

–or–

  1. If the workflow does start acting on the event I delivered, it should rollback as well. I don’t see how this could occur using the default scheduler, though. I’d like the workflow execution to remain asynchronous, so I don’t want to switch out the scheduler if I don’t have to.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T17:43:42+00:00Added an answer on May 11, 2026 at 5:43 pm

    There’s a couple of issues going on here. First, when you are using SQL persistence, notifying the workflow of events and having the workflow publish events is persistent and asynchronous and the underlying plumbing of the workflow is transactional…but not in the way you might think.

    If something horrible happens somewhere in the sequence of events that will eventually cause your workflow to transition to a new state, then the workflow will revert to the state it was in before attempting the activity – this keeps the workflow in a consistent state since being “between states” is a bad idea.

    Using a transaction scope as you’ve done above is fine, but you have to remember that the only time transaction scopes actually work is when the classes within the using block are aware of the the transaction scope.

    What you can do is have your call to “MyMethod” wrap things in a try/catch block. When something goes wrong, you can vote for a rollback… but this still doesn’t “un-invoke” the method on your EDES.

    If you can give some specifics about what you’re trying to accomplish at a higher level, there may be some things intrinsic to the WF that might better suit you than trying to shoehorn a transaction scope into the mix.

    Edit

    I did some digging and found a couple of different places where we are told that there is no API to manipulate the scheduler work queue. Unfortunately for us what this means is that any sort of rollback behavior that we want we’re going to have to implement by hand on our own.

    If I knew more about why you were trying to rollback work queued through an EDES I might be able to suggest some potential architectures for accomplishing your task without re-inventing the wheel (transactions).

    9 times out of 10 when I run into problems like this where it looks like WF just doesn’t support what I’m trying to do, the problem is because I’ve either kept too much code outside the workflow or tried to put too much code into it and refactoring where my work is done often fixes my problem without requiring me to write new stuff.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I'm looking for suggestions for debugging... If you view this site in Firefox or
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I want to count how many characters a certain string has in PHP, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.