Topic
14 replies Latest Post - ‏2006-05-14T14:30:00Z by SystemAdmin
SystemAdmin
SystemAdmin
2826 Posts
ACCEPTED ANSWER

Pinned topic Distributed Transactions - IBM.Data.DB2 2.0

‏2006-01-31T00:44:31Z |
Hi All,

We are attempting to use the System.Transactions.TransactionScope class as described within the following MSDN article to allow transactional updates to two DB2 databases:

http://msdn2.microsoft.com/en-us/library/ms172152.aspx

Whenever I invoke the connection's Open() method within the TransactionScope, the following exception is thrown:

[code]
IBM.Data.DB2.DB2Exception: ERROR 58005 IBMDB2/LINUX SQL0998N Error occurred during transaction or heuristic processing. Reason Code = "16". Subcode = "2-8004D026". SQLSTATE=58005

at IBM.Data.DB2.DB2ConnPool.a(DB2Connection A_0, String A_1, a& A_2, Object& A_3)
at IBM.Data.DB2.DB2Connection.Open()
at DB2TestConnection.Form1.button1_Click(Object sender, EventArgs e) in D:\My Documents\Visual Studio\Projects\DB2TestConnection\DB2TestConnection\Form1.cs:line 39
[/code]

The Information Center does not list Reason Code 16 within the list of possible codes.

http://publib.boulder.ibm.com/infocenter/db2v7luw/index.jsp?topic=/com.ibm.db2v7.doc/db2m0/sql0900.htm

I have seen errors relating the use of ADO 2.1 from classic ASP on google - with a registry fix to disable ODBC's resource pooling. As we are dealing with the IBM.Data.DB2 2.0 provider, I am unsure if this is a valid fix and if so where and how to change the configuration.

Any help on this would be greatly appreciated. Thanks in advance.
Brad
Updated on 2006-05-14T14:30:00Z at 2006-05-14T14:30:00Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    2826 Posts
    ACCEPTED ANSWER

    Re: Distributed Transactions - IBM.Data.DB2 2.0

    ‏2006-01-31T01:44:43Z  in response to SystemAdmin
    brad, would you also post format of your both connection string that you are using

    thanks
    • SystemAdmin
      SystemAdmin
      2826 Posts
      ACCEPTED ANSWER

      Re: Distributed Transactions - IBM.Data.DB2 2.0

      ‏2006-01-31T02:19:30Z  in response to SystemAdmin
      Hi Dega,

      ConnectionStrings I have tried are as follows.

      Server=10.1.1.149:50002;Database=REXAUDIT;User ID=appUser;Password=appPassword
      and;
      Server=localhost;Database=REXAUDIT;User ID=appUser;Password=appPassword

      We had alot of trouble connecting with the first connection string initially (as per the post http://www-128.ibm.com/developerworks/forums/dw_thread.jsp?forum=467&thread=105110&cat=19) but using the solution outlined we are now able to connect using both strings.
      Brad
  • SystemAdmin
    SystemAdmin
    2826 Posts
    ACCEPTED ANSWER

    Re: Distributed Transactions - IBM.Data.DB2 2.0

    ‏2006-01-31T03:04:50Z  in response to SystemAdmin
    Hi Brad,

    8004D026 = XACT_E_XA_TX_DISABLED

    It would appear your XA configuration in DTC as been disabled.
    Try this: Open "Component Services", go to "My Computer" and select properties.
    Click the "Security Configuration" button and select the check box
    for "Enable XA Transactions".

    Alvin.
    • SystemAdmin
      SystemAdmin
      2826 Posts
      ACCEPTED ANSWER

      Re: Distributed Transactions - IBM.Data.DB2 2.0

      ‏2006-01-31T04:07:01Z  in response to SystemAdmin
      Thanks Alvin,

      That seemed to have resolved that problem - however, another one has presented itself. The exception is now

      IBM.Data.DB2.DB2Exception: ERROR 58005 IBMDB2/LINUX SQL0998N Error occurred during transaction or heuristic processing. Reason Code = "16". Subcode = "2-80004005". SQLSTATE=58005

      at IBM.Data.DB2.DB2ConnPool.a(DB2Connection A_0, String A_1, a& A_2, Object& A_3)
      at IBM.Data.DB2.DB2Connection.Open()
      at DB2TestConnection.Form1.button1_Click(Object sender, EventArgs e) in D:\My Documents\Visual Studio\Projects\DB2TestConnection\DB2TestConnection\Form1.cs:line 39

      The 80004005 error seems to be a fairly common one relating to many different connection issues. Searching the Forums etc. I eventually came the following article and followed the instructions. It appears as though the installation for version 2 of the managed provider is now correctly registering the dlls.

      http://www-1.ibm.com/support/docview.wss?rs=71&context=SSEPGG&q1=windows+2003+XA+transaction+MSDTC&uid=swg21188896&loc=en_US&cs=utf-8=en

      Appreciate the assistance.
      Brad
      • bpgross
        bpgross
        627 Posts
        ACCEPTED ANSWER

        Re: Distributed Transactions - IBM.Data.DB2 2.0

        ‏2006-01-31T05:10:39Z  in response to SystemAdmin
        Brad,

        Your last issue is likely the same issue that we recently became aware of from another source - the install is registering the XA dll with the long path name, while the code is using the short path name. We have corrected this issue and both install and code will be using the long name.

        Brent.
        • SystemAdmin
          SystemAdmin
          2826 Posts
          ACCEPTED ANSWER

          Re: Distributed Transactions - IBM.Data.DB2 2.0

          ‏2006-01-31T06:12:55Z  in response to bpgross
          Thanks everyone,

          Finally got it working (with both short and long names within the registry as per previous post).
        • SystemAdmin
          SystemAdmin
          2826 Posts
          ACCEPTED ANSWER

          Re: Distributed Transactions - IBM.Data.DB2 2.0

          ‏2006-02-17T14:57:42Z  in response to bpgross
          I followed the instruction given on:
          http://www-1.ibm.com/support/docview.wss?rs=71&context=SSEPGG&q1=windows+2003+XA+transaction+MSDTC&uid=swg21188896&loc=en_US&cs=utf-8=en

          But still get:
          ERROR 58005 IBMDB2/NT SQL0998N Error occurred during transaction or heuristic processing. Reason Code = \"16\". Subcode = \"2-80004005\". SQLSTATE=58005\r\n"
          Source="IBM.Data.DB2"
          ErrorCode=-2147467259

          Any suggestion how to fix this? Thanks.
          • SystemAdmin
            SystemAdmin
            2826 Posts
            ACCEPTED ANSWER

            Re: Distributed Transactions - IBM.Data.DB2 2.0

            ‏2006-02-17T15:54:37Z  in response to SystemAdmin
            Hi Gary,

            Have you tried Brent's suggestion to use the full, long path name for the XADLL regsistry key value?

            Alvin.
            • SystemAdmin
              SystemAdmin
              2826 Posts
              ACCEPTED ANSWER

              Re: Distributed Transactions - IBM.Data.DB2 2.0

              ‏2006-02-17T18:09:26Z  in response to SystemAdmin
              Hi Alvin,

              This is what in the registry:
              C:\PROGRAM FILES\IBM\DB2NET20\BIN\DB2APP.DLL

              Looks the full path to me.
              • bpgross
                bpgross
                627 Posts
                ACCEPTED ANSWER

                Re: Distributed Transactions - IBM.Data.DB2 2.0

                ‏2006-02-17T18:29:11Z  in response to SystemAdmin
                Gary,

                The situation with the current Developers Release is that the install added the registry key with the long name, BUT the code is using the short name.

                If you add another registry entry with the short name you should be off to the races.

                Brent.
            • SystemAdmin
              SystemAdmin
              2826 Posts
              ACCEPTED ANSWER

              Re: Distributed Transactions - IBM.Data.DB2 2.0

              ‏2006-02-17T18:49:51Z  in response to SystemAdmin
              What is the short name? You mean just the DLL name? Thanks.
              • bpgross
                bpgross
                627 Posts
                ACCEPTED ANSWER

                Re: Distributed Transactions - IBM.Data.DB2 2.0

                ‏2006-02-17T18:56:12Z  in response to SystemAdmin
                The short name is the "8.3" name - for your case it would be something like:

                C:\PROGRA~1\IBM\DB2NET20\BIN\DB2APP.DLL

                using dir /x will show the short name.

                Brent.
                • SystemAdmin
                  SystemAdmin
                  2826 Posts
                  ACCEPTED ANSWER

                  Re: Distributed Transactions - IBM.Data.DB2 2.0

                  ‏2006-02-18T03:35:05Z  in response to bpgross
                  Thanks very much Brent. It worked. Thanks again for all your help.
                  • SystemAdmin
                    SystemAdmin
                    2826 Posts
                    ACCEPTED ANSWER

                    Re: Distributed Transactions - IBM.Data.DB2 2.0

                    ‏2006-05-14T14:30:00Z  in response to SystemAdmin
                    I tried this fix but it does not work for me.
                    Under the registry key ...XADLL, I have one value : DB2APP.DLL linked to the dll in short name format.
                    Is it correct ? Do I need something else ?

                    Thanks,
                    Bernard