Skip to Content
0

Integrating MSDTC with DI API HANA

Jul 04, 2017 at 02:55 PM

48

avatar image
Former Member

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); } }

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

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

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();

}

Share
10 |10000 characters needed characters left characters exceeded