Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Atomic transaction Orchestration
- This topic has 5 replies, 1 voice, and was last updated 9 years, 10 months ago by
community-content.
-
AuthorPosts
-
-
November 25, 2008 at 1:11 AM #21248
I have an Orchestration. There is an atomic transaction scope in it. All logic inside the Atomic transaction scope will be performed within a transaction… Inside the Scope element I put Send-Receive Direct port (solicit request), that sends message to MessageBox (as it is direct) and waits for response. That Message is being processed by another orchestration that, has Receive-Send port (request-response) as activator. Then the message is beig returned to the original orchestration with atomic transaction scope.
The question…
Will Transaction context of the parent orchestration (transaction scope) be spread on to the child orchestration…? OR.
Will the changes performed by the child orchestration be rolled back, If after the message is returned by the child orchestration I cause Rollback of the transaction of the Atomic Transaction scope ????
Thank you.
-
November 25, 2008 at 2:36 AM #21249
No the transaction context is not passed to the downstream orchestration. It is possible that the downstream orchestration will run in another process or even on another server.
The atomic transaction in an orchestration means that orchestration will persist its state at the beginning of the scope and remain active until the scope exits. If the Biztalk process terminates and restarts, the orchestration will restart at the beginning of the atomic scope. There is no mechanism to advise the downstream orchestration that this has happened. If you throw an exception inside the atomic scope there is no rollback, you cannot undo the send if it has completed. You can however add a compensation block to the scope and perform your own logic to undo what may have been done
I think putting a send/receive pair inside an atomic scope will be counter productive. There is no benefit and several possible problems including resending the message.
-
November 25, 2008 at 4:57 AM #21252
Ok. I see.
I have one broker orchestration, which accepts XML message. The message contains several submessages (1 – *). Each submessage has XML Element TradeType <TradeType>A</TradeType>. I use TradeType in order to route thate submessage to specific orchastration.. I have several orchestrations for each TradeType.
I want to transmitt each submessage from my broker orchestration to specific SubOrchestration (depending on the message TradeType value). But, If some message fails I want to roll back all submessages processings.
I think I have to create a broker Orchestration with Atomic transaction scope, put Loop element into the Scope, and extract submessages in Loop.
Then inside Loop goes If-Then Element which performs routing basing on TradeType. Insede each Branch I need to put Call orchestration element (because call orchestration element will allow me to spread transaction context on to the chil orchestration.)
-
November 25, 2008 at 9:17 AM #21253
This will still not give you the behaviour you would expect. Although the transaction will propagate to the child orchestration, it won’t go any further. If the child orchestrtaion calls a web service or sends via the SQL adapter the transaction does not propagate to these. The send port is separated from the orchestration by the messagebox, any error will not rollback a web service call or SQL adapter send.
You will need to introduce a compensation block and have undo functionality. Or some other mechanism to provide transactional integrity.
-
November 26, 2008 at 12:27 AM #21257
No… I will use code blocks for database operations. and transaction context will propogate. (i know that SQL adapter does not support transactions)
I beleive so.
But the behaviour I’m looking for – Is to be able to add new orchestrations for new TradeTypes without recompiling the Broker orchestration.
The broker has [If-Else-Else] Shape. And it needs to be changed when new trade types appear.
All I need – is routing with transaction support… Or maybe some magic in the Broker orchestration which will allow me to call child orchestrations without specifiing it.
-
November 9, 2009 at 6:44 AM #23698
You can use inverse partner direct binding (recipient list pattern) for the behavior you are looking for.
-
-
-
-
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.