Microsoft KB Archive/909256

= FIX: Multiple two-phase commit Transaction Integrator calls in an overall distributed transaction fail in Host Integration Server 2004 =

Article ID: 909256

Article Last Modified on 12/4/2007

-

APPLIES TO


 * Microsoft Host Integration Server 2004 Standard Edition

-





SYMPTOMS
Consider the following scenario. In Microsoft Host Integration Server 2004, you make multiple two-phase commit (2PC) Transaction Integrator (TI) calls in the context of an overall distributed transaction. In this scenario, the second TI call fails, and you receive an error message.

Note The error message text varies. One possible error message that you may receive is similar to the following:

System.Runtime.InteropServices.COMException (0x000005DC): (1500) The output buffer size has been exceeded while processing parameter  in method.



CAUSE
This problem occurs because the TI runtime sends incorrect input data to the host on the second TI call. The error message that you may receive depends on how the host program responds to the incorrect input.



RESOLUTION
A supported hotfix is now available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next service pack that contains this hotfix.

To resolve this problem, submit a request to Microsoft Online Customer Services to obtain the hotfix. To submit an online request to obtain the hotfix, visit the following Microsoft Web site:

http://go.microsoft.com/?linkid=6294451

Note If additional issues occur or any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. To create a separate service request, visit the following Microsoft Web site:

http://support.microsoft.com/contactus/?ws=support

The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.

Note Because of file dependencies, the most recent fix that contains these files may also contain additional files.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.



MORE INFORMATION
This problem only occurs when multiple TI calls are made in an overall distributed transaction. To use Microsoft Visual C# .NET to set up a project that makes two TI calls in an overall transaction, follow these steps:

Note These steps assume that the following conditions are true:
 * You know how to create, install, and make calls to TI Microsoft Component Object Model (COM) objects by using Microsoft Visual Studio .NET.
 * The environment is already set up for 2PC, and the following conditions are true:
 * The HIS LU62 Resync Service is started.
 * The application event log shows that a successful log name exchange (XLN) has occurred (Event 119).

 Create the TI COM objects, and then install the objects by using TI Manager.

Notes  Make sure that the Transaction Support setting for the TI component is set to Supported. For this example, the method property Include Context Parameter is set to False. For the code example in step 11, the two TI COM objects use the LU 6.2 Link model. The objects are named LinkA.Test and LinkB.Test. The LinkA.Test object contains the MyMethodA method, and the LinkB.Test object contains the MyMethodB method. </li> Open the Visual Studio .NET Command Prompt. To do this, click Start, click All Programs, click Microsoft Visual Studio .NET 2003, click Visual Studio .NET Tools, and then click Visual Studio .NET 2003 Command Prompt.</li> Locate the application folder for the console application.</li> Type the following commands:   sn -k TI_Tran.snk </li>  sn -k TI_COM.snk </li></ul>

Notes  The TI_Tran.snk command signs the assembly with a strong name.</li> The TI_COM.snk command signs the TI COM objects by using a strong name.</li></ul> </li> Create a new C# console application in Visual Studio .NET by using the following references:  The TI COM objects</li> The System.EnterpriseServices namespace</li></ul> </li> In Solution Explorer, rename class1.cs to TITran.cs.</li>  In the AssemblyInfo.cs file, comment out the following two lines of code. [assembly: AssemblyKeyFile(&quot;&quot;)] [assembly: AssemblyKeyName(&quot;&quot;)] </li> For the console application, click Properties on the Project menu.</li> <li>Under Common Properties - General, type TI_COM.snk in the Wrapper Assembly for ActiveX/COM Objects - Wrapper Assembly Key File box.</li> <li>Delete all the code in the TITran.cs file.</li> <li> Add the following code to the TITran.cs file. using System; using System.EnterpriseServices; using System.Reflection;

[assembly: ApplicationName(&quot;TI_Tran&quot;)] [assembly: AssemblyKeyFileAttribute(&quot;..\\..\\TI_Tran.snk&quot;)]

namespace TI_Tran {  ///    /// Example of having two TI transactional method calls /// within one overall rransaction. ///   class TI_Tran {     ///       /// The main entry point for the application. ///      [STAThread] static void Main(string[] args) {        Console.WriteLine(&quot;Starting program&quot;); TI_TranClass myTI_Tran = new TI_TranClass; string sOut; try {           sOut= myTI_Tran.TestTI_Transaction; Console.WriteLine(sOut); Console.Write(&quot;Press ENTER to exit&quot;); Console.ReadLine; }        catch (Exception ex) {           Console.WriteLine(&quot;\nException occurred calling TI_Tran\n&quot;); Console.WriteLine(ex.Message); Console.Write(&quot;Press ENTER to exit&quot;); Console.ReadLine; }     }   }   ///    /// The following application makes two different TI calls to a mainframe. /// The calls are set up as two-phase commit calls and will be  /// either committed or aborted. /// The TI objects are HIS 2004 TI COM LU6.2 Link objects ///   [Transaction(TransactionOption.Required)] public class TI_TranClass: ServicedComponent {     public TI_TranClass {     }      [AutoComplete] public string TestTI_Transaction {        string sRetInfo = &quot;Done - &quot;; LinkA.TestClass objTIA = new LinkA.TestClass; LinkB.TestClass objTIB = new LinkB.TestClass; try {           Console.WriteLine(&quot;Begin Test Tran&quot;); string sInput=&quot;AAAAAAAAAAAAAAAAAAAAAAAAA&quot;, sCommit; decimal dBal; Console.WriteLine(&quot;About to call first Link TI Method&quot;); objTIA.MyMethodA(ref sInput, out dBal); Console.WriteLine(&quot;Finished with first Link TI Method Call: &quot; + dBal.ToString); sInput = &quot;BBBBBBBBBBBBBBBBBBBBBBBBB&quot;; Console.WriteLine(&quot;About to call second link TI Method&quot;); objTIB.MyMethodB(ref sInput, out dBal); Console.WriteLine(&quot;Finished with second link call: &quot; + dBal.ToString); Console.WriteLine(&quot; sInput = &quot; + sInput); Console.Write(&quot;Shall we commit? (Y/N): &quot;); sCommit = Console.ReadLine; if ((sCommit == &quot;Y&quot;) || (sCommit == &quot;y&quot;)) {              Console.WriteLine(&quot;Committing&quot;); ContextUtil.SetComplete; sRetInfo = sRetInfo + &quot;Committed&quot;; }           else {              Console.WriteLine(&quot;Aborting&quot;); ContextUtil.SetAbort; sRetInfo = sRetInfo + &quot;Aborted&quot;; }        }         catch (Exception ex) {           //Something wrong occurred on the TI call. //An exception was thrown. //This class may want to post an application event //then re-throw the exception so the calling application can //capture it. throw ex; }        finally {           objTIA = null; objTIB = null; }        return sRetInfo; }  } } </li></ol>

For more information about how to set up distributed transactions in Visual Studio, click the following article number to view the article in the Microsoft Knowledge Base:

316247 How to perform a distributed transaction with a .NET provider by using ServicedComponent in Visual C# .NET

Additional query words: WIP

Keywords: kbbug kbfix kbqfe kbpubtypekc kbhotfixserver kbhis2004 KB909256

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.