.comment-link {margin-left:.6em;}

Ben Cops

Thursday, June 17, 2004

DTC Transactions from BizTalk 2004

DTC Transactions from BizTalk - this is a hot topic. Nobody blogging on this seems to have run a quick test on this yet?
Anyway, a colleague did the other day - it turns out that if you use a serviced component set to "supports" or "requires transactions" in an atomic scope with a send shape, the work the component does is enlisted in the DTC transaction that inserts the message into the message box.
Correspondingly, if its set to "requires new", its not enlisted in that transaction.

What does this mean? Well for a start, when you send the message, although control will pass to the next shape in the scope as if the message has been sent, the message won't have been sent. Remember that a send shape doesn't really put the message on whatever transport you're targeting through your port, it just puts it in the message box and marks it for the port specified in the orchestration and its bindings. Later on, the subscriber (the send pipeline), picks up the message and forwards it on. You can see this in those "transport ID" tags in BTSSubscriptionViewer.exe. So if you do this put inside a running DTC transaction, the message will have been written but not committed to the message box (which is, of course, simply a SQL Server database). Only when the scope shape is finished can the message be committed to the database. This is the point at which the message is picked up by the send pipeline, and handed to the adapter specified by your physical port, which puts it on the target transport.

So don't try listening for a reply in an atomic scope shape.


Post a Comment

<< Home