Transactional Message Batches

Some adapters must coordinate an external transaction with an internal BizTalk Server transaction. For example, the SQL adapter supplied with BizTalk Server must coordinate a SQL Server transaction with a BizTalk Server transaction. To do this, the adapter needs access to the BizTalk Server transaction object. A transaction object is explicitly created and associated with the batch before the batch is submitted to BizTalk Server. A batch that has an associated transaction object is called a transactional batch. By supplying your own Microsoft Distributed Transaction Coordinator (MSDTC) transaction object, you can achieve the "guaranteed, once and once only", delivery of data into and out of BizTalk Server.

Transactional database adapters like the SQL adapter have the potential for deadlocks in the external database because of the single transaction used for the batch. This is why the batch size for the SQL adapter is hard-coded to one.

Should the adapter need to enlist additional resource managers, such as another database or MSMQ, within the scope of that transaction, it must create and pass to the Messaging Engine an explicit external transaction. Creating an external transaction and associating it with a batch is a called a transactional batch. A transactional adapter is an adapter that makes use of transactional batches by explicitly creating an external Microsoft Distributed Transaction Coordinator (MSDTC) transaction.

One of the reasons an adapter provides BizTalk Server with a transaction is to ensure that either BizTalk Server or the external system has a record of the data. This record ensures the message is delivered once and only once.


For more information about MSDTC, see the documentation for the Distributed Transaction Coordinator at:

The File adapter is an example of an adapter that does not require access to the transaction because the external file operations it manages are not transactional. In this case, the adapter does not provide a transaction object to BizTalk Server. The SQL adapter, on the other hand, interacts with an SQL database and may have additional operations outside of its BizTalk Server message interactions. An external MSDTC transaction in this case may make sense for the adapter to pass to BizTalk Server.

In This Section