on 06-10-2007 4:51 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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)?
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
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
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
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
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
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.