BizTalk Orchestration Error Message – Using Parallel Action – if shared data is updated in a parallel then all references in every task must be in a synchronized or atomic scope

  • Sandro Pereira
  • Jan 17, 2011
  • 2 min read

In BizTalk Orchestrations, the Parallel Actions shape is a powerful tool for executing multiple tasks simultaneously. However, it comes with a strict rule: You cannot update a shared variable across multiple branches without proper synchronization.

📝 One-Minute Brief

When multiple branches of a Parallel Actions shape in a BizTalk Orchestration attempt to update the same shared variable or message, the engine throws an error to prevent data inconsistency. To fix this, any reference to shared data within a parallel branch must be wrapped in a Synchronized Scope or an Atomic Scope. This ensures that only one branch accesses the data at a time, maintaining thread safety and orchestration integrity.

Scenario

I have one scenario where, at the end of the orchestration, I will deliver a notification to the client. One branch will send a notification by SMS, another by email, but both branches make use of one orchestration variable: UserProperties.

BizTalk Orchestrations parallels actions

When using a parallel shape inside an orchestration that makes use of a given orchestration variable, you can get a compiler error:

varName‘: if shared data is updated in a parallel then all references in every task must be in a synchronized or atomic scope

Solutions

To solve this error, you have two options:

Solution 1

If you want to use translations inside the branches, you need to:

  • Open Scope Properties of each branch.
  • Set the Synchronized property to True.
BizTalk Orchestrations parallels actions Properties

Solution 2

If you don’t need to use translations inside the branches!!

  • Just set the Transaction Type property to None.

While parallel processing speeds up execution, data integrity is more important. By correctly using Synchronized or Atomic scopes, you can take advantage of parallel paths without risking orchestration failures.

Thanks for Buying me a coffe
Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc. He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.

3 thoughts on “BizTalk Orchestration Error Message – Using Parallel Action – if shared data is updated in a parallel then all references in every task must be in a synchronized or atomic scope”

  1. how to ope scope properties? I select the parallel shape and right click the properties, but its not showing the properties as shown above in the figure.

    1. Hi Shah Faisal,

      Sorry for the response delay, the properties that are in the image are related to the Scope shape, which are in the parallel shape.

      So drag the scope shape into one branch of the parallel shape and right click the properties.

  2. Hi Sandro, Let me clarify the 2 options :

    1. Transaction Type = Atomic ; Synchronized = True
    2. Transaction Type = None ; Synchronized = False

    Kindly sugest.

Leave a Reply

Your email address will not be published. Required fields are marked *

The Ultimate Cloud
Management Platform for Azure

Supercharge your Azure Cost Saving

Learn More
Turbo360 Widget

Back to Top