PRB: "Failed to Parse the XML Document" Error Message in BizTalk Adapter for SQL Server When a Stored Procedure Updates a Remote Computer That Is Running SQL Server (833190)



The information in this article applies to:

  • Microsoft BizTalk Adapter for SQL Server 1.0

SYMPTOMS

Documents that are processed by the Microsoft BizTalk Adapter for Microsoft SQL Server cannot be processed and an error that is similar to the following is generated in the application log of the BizTalk server:
Event Type:	Error
Event Source:	BizTalk Server
Event Category:	Document Processing 
Event ID:	324
Date:		12/1/2003
Time:		12:22:36 PM
User:		N/A
Computer:	BIZTALKSERVER
Description:
An error occurred in BizTalk Server.
 
 Details:
 ------------------------------
 [0x80004005] Failed to parse the XML Document, please refer to the 
 trace log for more information
 [0x0159] The server encountered a transport error while processing 
 the messaging port "SQL Adapter Test", which uses a transport component 
 with a ProgID of "AICSQL.SQLPipeline.1".
 [0x012a] All retry transmissions failed.
 [0x80004005] Unspecified error
 [0x0156] The server could not finish processing messaging port "SQL 
 Adapter Test".
 [0x1730] Suspended Queue ID: "{486D86ED-126B-40BA-B9B2-0FF21CC47A15}"
 [0x80004005] Unspecified error

For more information, see Help and Support Center at 
http://support.microsoft.com.
When this error occurs, a profiler trace of the table that contains the stored procedure will reveal an error that is similar to the following:
OLE/DB Provider 'SQLOLEDB' ITransactionLocal::StartTransaction 
returned 0x8004d013:  ISOLEVEL=1048576
The HRESULT 8004d013 is found in the Winerror.h file and translates to the following:

// MESSAGEID: XACT_E_XTIONEXISTS
// MESSAGETEXT:
// AN ENLISTMENT IN A TRANSACTION 
ALREADY EXISTS.
#DEFINE XACT_E_XTIONEXISTS  _HRESULT_TYPEDEF_(0X8004D013L)

This error occurs if BizTalk Adapter for SQL Server is configured to call a stored procedure that updates tables on a remote server that is running Microsoft SQL Server.

CAUSE

This error occurs if the stored procedure that is executed does not use the following statement to specify that SET XACT_ABORT is set to ON:
SET XACT_ABORT ON
SET XACT_ABORT must be set to ON to allow for data modification statements in an implicit or an explicit transaction. All stored procedures that are called by BizTalk Adapter for SQL Server are implicitly participating in the transaction that is initiated by the BizTalk Messaging engine when it passes a document to BizTalk Adapter for SQL Server for processing.

RESOLUTION

Add the SET XACT_ABORT ON statement to your stored procedure to make sure that it participates in the transaction that is initiated by the BizTalk Messaging Engine. For example, in the excerpt of the stored procedure that is listed in this section, the SET XACT_ABORT statement is included just below the AS statement:
CREATE PROCEDURE [dbo].[sp_bt_insert_order]
(
  @buyer [char](30),
  @orderdesc [char](30),
  @tracking [char](10),
)
AS
SET XACT_ABORT ON . . .

STATUS

This behavior is by design.

MORE INFORMATION

For additional information about the SET XACT_ABORT statement, see the SQL Server 2000 Books Online.

Modification Type:MajorLast Reviewed:9/22/2006
Keywords:kbprb KB833190 kbAudDeveloper