Hi!
I'm evaluating the possibility for developing some apps in C++ using unixODBC accessing MaxDB (7.5.0.23).
During tests I've found a little bug.
To make clear what I'm doing, I've created a class that connect to database during a "open(char*, char*, char*)" method, and close connection and free all handles in destructor. The code was adapt from C sample described in unixODBC tutorial. I'm using Fedora Core 2, with default unixODBC (but with all latest yum updates).
So, the steps my main() app does is:
try { MyClass myClass; myClass.open("MY_DSN", "myusername", "mypassword"); cout << "It's open" << endl; } catch(DbException&) { cout << "Huh, exception occured!"; }
And I've put similar messages in c'tor and d'tor of the class ("MyClass was created" and "MyClass was destructed and handles are free").
The problem is reproducible always:
1) Start XServer but no DATABASE.
2) Start App. I'll get "MyClass was created", a database message saying database not running, and nothing more.
3) Start database.
4) Start App. I'll get "MyClass was created", and the app hangs forever.
No matter how many instances of the app starts, all hang.
If I change the order of operations (and after a machine restart), everything works fine:
1) Start XServer and Database.
2) Stop database
3) Start App. I'll get "MyClass was created", and a database messages saying database not running, then "MyClass was destructed and handles are free", and finally "Huh, exception occured!".
4) Start database.
5) Start App. I'll get "MyClass was created", "It's open!", then "MyClass was destructed and handles are free".
6) Stop database
7) Start App. I'll get "MyClass was created", and a database messages saying database not running, then "MyClass was destructed and handles are free", and finally "Huh, exception occured!".
No matter how many instances of the app starts, never hang.
So, appear that I need to start the DATABASE at least one time to get unixODBC working with MaxDB driver, under risk of never get odbc working again...
I've made similar tests using PostgreSQL, but can't reproduce, so I suspect MaxDB driver is not releasing something else...
Can someone put a light on there?
TIA,
-- Edson Carlos Ericksson Richter MGR Informática Ltda. Fones: 3347-0446 / 9259-2993
-- MaxDB Discussion Mailing List For list archives: http://lists.mysql.com/maxdb To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]