cancel
Showing results for 
Search instead for 
Did you mean: 

MAX DB and COM+ MTS

Former Member
0 Kudos

I connect to maxdb database with SQLSTUDIOODBC driver. It is called from COM+ object written in C+. When I configure the COM properties with "Transactions required" i get an error:

Error code: -2147168246 (which is "Unable to enlist in the transaction. ")

Error description: [MySQL MaxDB][SQLOD32 DLL] Option type out of range

Can someone help me solve this problem?

Thanks

Daphna

Accepted Solutions (0)

Answers (1)

Answers (1)

TTK
Employee
Employee
0 Kudos

Hello Daphna,

please send me a driver manager trace (via Windows admin tool: Data Source Administrator) and the trace, when you enable the internal driver trace (define with above admin tool a User DSN for SQLSTUDIOODBC, -> settings, enable trace. Of course, you have to connect through this DSN then).

Regards Thomas

Former Member
0 Kudos

This is the content of the trace file:

<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body ><PRE><PLAINTEXT>

PRODUCT : MaxDB C-PreComp Runtime

VERSION : 7.6.00

BUILD : 015-023-000-000

DATASOURCE: Ingeneo Test MAXDB

SESSION : 1;

SQLMODE : INTERN

SERVERDB : CRM

SERVERNODE: ILINGENEO09

CONNECT "USRCRM " IDENTIFIED BY :A ISOLATION LEVEL 1

KERNEL FEATURES :

OPTIMIZED STREAMS

START : DATE : 2007-06-11 TIME : 0012:01:31

END : DATE : 2007-06-11 TIME : 0012:01:31

S1: DISCONNECT

SQCFINISH

TTK
Employee
Employee
0 Kudos

Well, nothing to see. The driver manager trace could reveal some more details. FYI, the internal trace shows, that the ODBC-driver did a connect and a disconnect. Maybe the application code tried to get some information from the ODBC-driver (SQLGetInfo etc), which it did not like.

Former Member
0 Kudos

Thanks for your help!

The problem is the COM+ transactions because when I change the transactions property in the COM+ from required to supported the program works fine which means that the SQL queries are ok. I believe the driver as it is does not support Miscrosoft transactions that are handeled by the COM. Do you know anyone that can help me with this specific combination ODBC driver for MAXDB and MTS (COM transactions)?

TTK
Employee
Employee
0 Kudos

Unfortunately I do not know somebody with this knowledge.

Just a colleague remarked that if you are using something like distributed transactions, it will probably not work with the ODBC bridge.

If not, I could examine the problem from ODBC point of view. If you can provide me with a small example reproducing the problem, it could help.

Regards Thomas

Former Member
0 Kudos

Yes, the COM+ runs under MSDTC (Miscrosoft distributed transaction coordinator).

To send an example is not so easy. It consists of sverearal steps:

1. Create COM object with a method that inserts something to a table: (INSERT INTO <table> (<field name>) VALUES (<field value>)

2. Open Component services and install the dll as COM+

3. Configure the transcations property of the COM+ as required.

4. Set an ODBC entry to the database

5. Write a program that calls the method in the COM+

Thanks again

Daphna

TTK
Employee
Employee
0 Kudos

In <a href="http://technet.microsoft.com/en-us/library/ms403286(SQL.90).aspx">MSDN</a> I found, that MS-SQL used an additional connect attribute for MSDTC:

<excert>

Call SQLSetConnectAttr one or more times for each ODBC connection you want to enlist in the MS DTC transaction. SQLSetConnectAttr second parameter must be SQL_ATTR_ENLIST_IN_DTC and third parameter must be the Transaction object (obtained in Step 3).

</excert>

Inside the MaxDB driver, there is no handling of above mentioned Transaction Objects. Therefore, I guess, it will not work.

The error message in your initial post:

[MySQL MaxDB][SQLOD32 DLL] Option type out of range

is probably the error returned of SQLSetConnectAttr, since MaxDB ODBC does not process SQL_ATTR_ENLIST_IN_DTC (which does not belong to the ODBC reference).

I'm afraid, that you will not be able to run COM+ as intended at your site.

Regards Thomas

Former Member
0 Kudos

Thanks.

Do you have any idea how can I bypass this problem and do it some other way?

Daphna

TTK
Employee
Employee
0 Kudos

Besides that I do not know your requirements, I can say, that the distributed transaction stuff of MS will not work with the MaxDB ODBC driver.

Is the "transactions required" mode mandatory for your application?

Former Member
0 Kudos

Our project is written in C++ in uses the SQL Server DB. Now we have to support MaxDB and Oracle as well. The combination COM+ and transactions is the way we worked with the SQL Server. The database is not distributed but it is on another server. We hoped we could work with MaxDB the same way.

What other alternatives do we have (one way is to handle the transactions ourselves)?

Thanks Daphna

TTK
Employee
Employee
0 Kudos

First, it does not matter, whether the DB is remote or not. If you have only a single DB, you can rely on the transaction handling of the DB. I don't know, how COM+ handles transactions, but the transaction handling in ODBC is not complicated (cmp. SQLEndTran, SQLSetConnAttr(SQL_ATTR_AUTOCOMMIT)).

HTH and regards

Thomas