Logo
programming4us
programming4us
programming4us
programming4us
Home
programming4us
XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
Windows Azure

SOA with .NET and Windows Azure : Orchestration Patterns with BizTalk Server - State Repository & Compensating Service Transaction

5/28/2011 3:24:59 PM
- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019

3. State Repository

Microsoft’s BizTalk Server manages orchestration state in much the same way as WF, except that state management is not extensible or configurable. BizTalk Server always stores the state of an orchestration in a SQL Server database to ensure durable and scalable storage (Figure 1). This results in a natural application of State Repository , a pattern that is used for a range of state deferral options.

Figure 1. The state management mechanism provided by BizTalk Server behaves the same way as its WF counterpart, but appears simpler because the mechanics are abstracted by the BizTalk platform.

The BizTalk runtime engine dehydrates idle orchestration instances whenever possible to conserve server resources. The orchestration engine detects when the orchestration becomes idle and waits for a certain period of time, then persists the orchestration into the SQL Server database and frees up any server resources associated with that instance of the fulfillment process.

BizTalk rehydrates an orchestration when it receives a message for the orchestration instance giving it an indication that it’s time to resume processing. For this to work, BizTalk needs to be able to identify data in a message that can uniquely identify the orchestration instance to rehydrate. For this purpose, it is common to use correlation types.

It is expected that, while hydrated, an orchestration remains stateful until its execution is completed. The services composed by the orchestration logic, on the other hand, are preferably designed to defer state via State Repository, or other patterns, such as Stateful Services, Partial State Deferral, or even State Messaging.

Compensating Service Transaction

BizTalk supports compensation-style transactions in compliance with the application of the Compensating Service Transaction pattern. Compensation logic generally needs to be invoked when an orchestration needs to clean up work it performed successfully before another part of the orchestration failed.

You configure an orchestration for compensation by setting the Transaction Type property of a Scope to Long Running as illustrated in Figure 2.

Figure 2. A scope’s Transaction Type property can be set to compensation-based transactions and ACID transactions.

BizTalk will automatically invoke the compensation handler (and nested handlers) as needed to invoke compensating service operations when an error occurs during the execution of the scope.

Just like a catch block behaves as an exception handler in a C# routine, the compensation handler is simply extra logic that is explicitly invoked under certain conditions.

Figure 3 shows how each scope can define a separate compensation handler.

Figure 3. The compensation handler on the bottom of a scope executes when the orchestration code inside the scope throws an exception.

The compensation algorithm displayed in Figure 3 creates two messages to cancel orders in two other services. Note that when applying Compensating Service Transaction, there is no rollback of changes. The most common approach is to equip service contracts with compensating capabilities that correspond to the original capabilities that were executed up until that point (for example, a CreateOrder operation may have a corresponding CancelOrder operation).

Note

BizTalk Server also supports the application of Atomic Service Transaction with a two-phase commit protocol. This allows for the ACID transactions to occur within orchestrations and within the scope of broader compensation transactions, if necessary.

For longer-running orchestrations, it is more common to manage exceptions using Compensating Service Transaction  because the use of Atomic Service Transaction requires that resources be locked and the original (pre-transaction) state be preserved in order to enable subsequent rollback of changes to the original state.

Prior to the integration of WCF, BizTalk server did not support the WS-AtomicTransaction industry standard. Therefore, BizTalk 2006 and earlier versions could only coordinate transactions across resources where appropriate resource managers are available.

Other -----------------
- SOA with .NET and Windows Azure : Orchestration Patterns with BizTalk Server - Process Centralization
- Orchestration Patterns with BizTalk Server : Example
- Orchestration Patterns with BizTalk Server : Process Abstraction and Orchestrated Task Services
- SOA with .NET and Windows Azure : WCF Extensions - WCF Management Tools
- SOA with .NET and Windows Azure : WCF Extensions - WCF Extensibility
- SOA with .NET and Windows Azure : WCF Extensions - WCF Discovery
- Service-Orientation with .NET : Entity Abstraction with a .NET REST Service
- Service-Orientation with .NET : Utility Abstraction with a .NET Web Service
- Service-Orientation with .NET : Service Reusability and the Separation of Concerns
- Service-Orientation with .NET : Service Discoverability
 
 
Top 10
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
 
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server