Connecting to a MaxDB Database via ODBC (porting old C++ application to Zope)
Hi, I am developing a Zope web application which relies on an existing Database (MaxDB, formerly SAPDB) Client written in C++. This client accessed my database via ODBC (on UNIX). My web application should on one hand access the database directly via a Zope Database Adapter and on the other hand use functions from this C++ Client which also accesses the database. (Some functions of this C++ Client are compiled as a library which can then be called from Zope). What I now need is a way to access my Database over one Database connection. What I am thinking of is to use some Zope Database Adapter that uses ODBC, and give the database handle to my C++ functions. My problem is: How would I get the ODBC Database handle from the Zope Database Adapter object? Is this easy to do? Will I run into problems by doing this? Moreover I don't know if there's a ODBC Database adapter available which is compatible to Zope and to MaxDB. There is a MaxDB Zope DA available but this does not rely on ODBC. Then there is this commercial mxODBC available but I don't know if it supports MaxDB. Can you give my some hints? Best Regards, Hermann -- x1@aon.at GPG key ID: 299893C7 (on keyservers) FP: 0124 2584 8809 EF2A DBF9 4902 64B4 D16B 2998 93C7
Hermann Himmelbauer wrote at 2004-12-5 11:48 +0100:
... My web application should on one hand access the database directly via a Zope Database Adapter and on the other hand use functions from this C++ Client which also accesses the database. (Some functions of this C++ Client are compiled as a library which can then be called from Zope).
What I now need is a way to access my Database over one Database connection.
Why?
What I am thinking of is to use some Zope Database Adapter that uses ODBC, and give the database handle to my C++ functions.
Should your C++ functions manage transactions, this would be a recipe for desaster (I exaggerate a bit).
My problem is: How would I get the ODBC Database handle from the Zope Database Adapter object?
This is not a Zope question at all but a question relating to the specific database adapter object you plan to use (I recommend "mxZODBCDA"; it is commercial, but *much* better than the free "ZODBCDA"). I do not use ODBC (and related DAs) and therefore cannot answer the specific question.
Is this easy to do?
I would not do it. Instead, I would use independent connections, both tied in to Zope's transaction system. This, too, would require that your C++ functions do not have their own understanding of transactions.
Will I run into problems by doing this?
You will need to find out yourself, I fear....
Moreover I don't know if there's a ODBC Database adapter available which is compatible to Zope and to MaxDB.
Fortunately, the DA depends only on ODBC and not the database system accessed via ODBC (unless there are no reliable ODBC drivers for this database system). Look for "mxODBC". -- Dieter
participants (2)
-
Dieter Maurer -
Hermann Himmelbauer