Skip to Content
avatar image
Former Member

Integrating MSDTC with DI API HANA

Hi,

I'm trying to create transactions across 2 systems, one being a SQL server and the other being a SAP HANA server.

code is in c#:

var transactionOptions = new TransactionOptions { IsolationLevel = IsolationLevel.Unspecified }; using (var transaction = new TransactionScope(TransactionScopeOption.Required, transactionOptions,EnterpriseServicesInteropOption.Automatic)) { try { ITransaction estx = null; if (Transaction.Current != null) estx = (System.EnterpriseServices.ITransaction)TransactionInterop.GetDtcTransaction(Transaction.Current); comp.DTCTransactionObject = estx; // do some sap stuff and do some other stuff transaction.Complete(); } catch (Exception ex) { var nonSapErr = ex.Message; comp?.GetLastError(out int errCode, out string errMsg); } }

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Jul 04, 2017 at 03:00 PM

    EDIT:

    Hi sorry for unreadable question.

    with the following c# code using the DI API v9.0 I get the following error:

    [SAP AG][LIBODBCHDB DLL] Optional feature not implemented

    var transactionOptions = new TransactionOptions { IsolationLevel = IsolationLevel.Unspecified };

    using (var transaction = new TransactionScope(TransactionScopeOption.Required,transactionOptions,EnterpriseServicesInteropOption.Automatic))

    {

    ITransaction estx = null;

    if (Transaction.Current != null)

    estx = (System.EnterpriseServices.ITransaction)TransactionInterop.GetDtcTransaction(Transaction.Current);

    comp.DTCTransactionObject = estx;

    // do sap stuff and other stuff

    transaction.Complete();

    }

    Add comment
    10|10000 characters needed characters exceeded