Microsoft KB Archive/909256

From BetaArchive Wiki
Knowledge Base


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 ParameterName in method MethodName.

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:

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:



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.

File name File version File size Date Time Platform Service pack requirement
Capture.dll 6.0.1989.0 25,600 07-Oct-2005 22:32 x86 SP1
Dcgen.dll 6.0.1989.0 98,816 07-Oct-2005 22:32 x86 SP1
Microsoft.hostintegration.ti.dcgen.interop.dll 6.0.1701.0 4,096 07-Oct-2005 22:32 x86 SP1
Mobase.dll 6.0.1989.0 249,344 07-Oct-2005 22:31 x86 SP1
Playback.dll 6.0.1989.0 24,064 07-Oct-2005 22:32 x86 SP1
Tagen.dll 6.0.1989.0 94,720 07-Oct-2005 22:32 x86 SP1
Turnaround.dll 6.0.1989.0 34,304 07-Oct-2005 22:32 x86 SP1

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 "Applies to" 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).
  1. 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.
  2. 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.
  3. Locate the application folder for the console application.
  4. Type the following commands:
    • sn -k TI_Tran.snk
    • sn -k TI_COM.snk

    Notes

    • The TI_Tran.snk command signs the assembly with a strong name.
    • The TI_COM.snk command signs the TI COM objects by using a strong name.
  5. Create a new C# console application in Visual Studio .NET by using the following references:
    • The TI COM objects
    • The System.EnterpriseServices namespace
  6. In Solution Explorer, rename class1.cs to TITran.cs.
  7. In the AssemblyInfo.cs file, comment out the following two lines of code.

    [assembly: AssemblyKeyFile("")]
    [assembly: AssemblyKeyName("")]
  8. For the console application, click Properties on the Project menu.
  9. Under Common Properties - General , type TI_COM.snk in the Wrapper Assembly for ActiveX/COM Objects - Wrapper Assembly Key File box.
  10. Delete all the code in the TITran.cs file.
  11. Add the following code to the TITran.cs file.

    using System;
    using System.EnterpriseServices;
    using System.Reflection;
    
    [assembly: ApplicationName("TI_Tran")]
    [assembly: AssemblyKeyFileAttribute("..\\..\\TI_Tran.snk")]
    
    
    namespace TI_Tran
    {
       /// <summary>
       /// Example of having two TI transactional method calls
       /// within one overall rransaction.
       /// </summary>
       class TI_Tran
       {
          /// <summary>
          /// The main entry point for the application.
          /// </summary>
          [STAThread]
          static void Main(string[] args)
          {
             Console.WriteLine("Starting program");
             TI_TranClass myTI_Tran = new TI_TranClass();
             string sOut;
             try
             {
                sOut= myTI_Tran.TestTI_Transaction();
                Console.WriteLine(sOut);
                Console.Write("Press ENTER to exit");
                Console.ReadLine();
             }
             catch (Exception ex)
             {
                Console.WriteLine("\nException occurred calling TI_Tran\n");
                Console.WriteLine(ex.Message);
                Console.Write("Press ENTER to exit");
                Console.ReadLine();
             }
          }
       }
       /// <summary>
       /// 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
       /// </summary>
       [Transaction(TransactionOption.Required)]
       public class TI_TranClass: ServicedComponent
       {
          public TI_TranClass()
          {
          }
          [AutoComplete]
          public string TestTI_Transaction()
          {
             string sRetInfo = "Done - ";
             LinkA.TestClass objTIA = new LinkA.TestClass();
             LinkB.TestClass objTIB = new LinkB.TestClass();
             try
             {
                Console.WriteLine("Begin Test Tran");
                string sInput="AAAAAAAAAAAAAAAAAAAAAAAAA", sCommit;
                decimal dBal;
                Console.WriteLine("About to call first Link TI Method");
                objTIA.MyMethodA(ref sInput, out dBal);
                Console.WriteLine("Finished with first Link TI Method Call: " + dBal.ToString());
                sInput = "BBBBBBBBBBBBBBBBBBBBBBBBB";
                Console.WriteLine("About to call second link TI Method");
                objTIB.MyMethodB(ref sInput, out dBal);
                Console.WriteLine("Finished with second link call: " + dBal.ToString());
                Console.WriteLine("  sInput = " + sInput);
                Console.Write("Shall we commit? (Y/N): ");
                sCommit = Console.ReadLine();
                if ((sCommit == "Y") || (sCommit == "y"))
                {
                   Console.WriteLine("Committing");
                   ContextUtil.SetComplete();
                   sRetInfo = sRetInfo + "Committed";
                }
                else
                {
                   Console.WriteLine("Aborting");
                   ContextUtil.SetAbort();
                   sRetInfo = sRetInfo + "Aborted";
                }
             }
             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;
          }
       }
    }

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