Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


View products that this article applies to.

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.

↑ Back to the top


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.

↑ Back to the top


Resolution

Cumulative update information

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

↑ Back to the top


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. 

↑ Back to the top


Status

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

↑ Back to the top


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. 

↑ Back to the top


Keywords: kbautohotfix, kbqfe, kbhotfixserver, kbfix, kb

↑ Back to the top

Article Info
Article ID : 2985734
Revision : 3
Created on : 3/30/2017
Published on : 3/30/2017
Exists online : False
Views : 309