Inserts and stored procedure calls are processed in reverse order when you use BizTalk Adapter for DB2

Symptoms

When you issue multiple SQL queries or stored procedure calls in a single <sync> block in Host Integration Server 2013, the calls are processed in the reverse order from what you expect. For example, the following XML code sample includes multiple stored procedure calls in a single <sync> block:

<sync>
<StoredProcedure>
<SP_CHAR_INOUT INOUTVAL1 ="ABCDEFGHIJ" />
</StoredProcedure>
<StoredProcedure>
<SP_CHAR_INOUT INOUTVAL1 ="BCDEFGHIJK" />
</StoredProcedure>
<StoredProcedure>
<SP_CHAR_INOUT INOUTVAL1 ="CDEFGHIJKL" />
</StoredProcedure>
</sync>

In this example, the last stored procedure call in the <sync> block is the first one that is executed.

Cause

BizTalk Adapter for DB2 stores the records in a <sync> block in a stack that is executed in reverse order. This behavior has been part of BizTalk Adapter for DB2 ever since Host Integration Server 2006.

Resolution

Cumulative update information

The fix that resolves this problem is included in Cumulative Update 2 for Host Integration Server 2013.

Workaround

To execute SQL queries or stored procedure calls in the listed order, put each query or stored procedure call into its own <sync> block, as in the following example:

<sync>
<StoredProcedure>
<SP_CHAR_INOUT INOUTVAL1 ="ABCDEFGHIJ" />
</StoredProcedure>
</sync>
<sync>
<StoredProcedure>
<SP_CHAR_INOUT INOUTVAL1 ="BCDEFGHIJK" />
</StoredProcedure>
</sync>
<sync>
<StoredProcedure>
<SP_CHAR_INOUT INOUTVAL1 ="CDEFGHIJKL" />
</StoredProcedure>
</sync>

Note When you put each query or stored procedure call into its own <sync> block, and one of the queries or stored procedure calls fails for any reason, you receive incomplete updates in the DB2 database because each statement is handled in its own transaction. 

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

More Information

After you apply this update, BizTalk Adapter for DB2 processes each SQL query and stored procedure call that's contained in a <sync> block in the order in which it is listed in the accompanying XML file. 

Need more help?

Expand your skills
Explore Training
Get new features first
Join Microsoft Insiders

Was this information helpful?

Thank you for your feedback!

Thank you for your feedback! It sounds like it might be helpful to connect you to one of our Office support agents.

×