質問

I have an orchestration which receives an xml via direct binding.

In the orchestration I have to perform these tasks:

  • Call 1 stored procedure to create a batch id (name IN, batchID OUT, errorCode OUT)
  • Perform multiple inserts in a table matching the records in the xml (0..n unbounded), each record is one table row insert. I use a map to match the XML elements to the columns in the table.
  • Call 1 stored procedure to end the batch (batchID IN, recordCount IN, errorCode OUT)

The DB calls must be done with the WCF-SQL adapter in Biztalk 2010.

My questions:

  • How do I pass the batch ID of the 1st SP to the mapper (each record starts with a batchID column) ?
  • The inserts within 1 XML must be regarded as one transaction. When one the inserts fails, the records must be rolled back. How is this achieved ?
役に立ちましたか?

解決

To answer your first question, you make you map a multi-input-schema map and use the response message from your Create Batch stored proc call as one of the input schemas. To do this see my answer to this question here Creating BizTalk map with multiple input schema

As for your second question, if you are doing this with a table operation using the WCF-SQL adapter you can set the useAmbientTransaction property to true in the sqlBinding configuration which will wrap multiple calls in one transaction.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top