Page 1 of 1
BDS 2006 and MySQL 5.0
Posted: 17.12.2005, 13:58
by Aquineas
Hey folks, newbie Zeos user here. I'm using the release version of BDS 2006 (C++ Builder Personality), and I just made a simple form with a "Connect" button. I basically connect (successfully) to the database, and when the form is shutting down (in a Close event), I disconnect (if connected).
I reach the destructor of my form, but for some reason the application isn't shutting down completely, and in the past when I've seen stuff like this, it's usually been thread related.
- Has anyone run into this?
- Is there anyplace in Zeos that there's threading code I could possilby look at to help determine the problem? I'm really not sure if the problem is here or in the MySQL 5.0.16 client driver
- Could the fact that I'm running a dual core setup be exposing some previously unknown threading issue?
Posted: 17.12.2005, 15:18
by Aquineas
More data points. I used the built-in dbExpress driver to connect to the database and disconnect at form closing (basically the same thing I was doing with Zeos), and I see the same number of spawned threads created at connection time (five), but shutdown happens gracefully.
My suspicion is that somehow the call to shutdown mysql isn't happening. Is this something I typically need to do manually? This could be an iD10T programmer error on my part...
Posted: 29.12.2005, 11:49
by Aquineas
Okay, so I've done some more research into this. Apparently, I'm not the only one with this
problem:
I wrote a standalone "C" app using VS2005 against libmysql, and verified that after closing a database, those same threads are still left laying around. So something in the mysql client library is causing this. I looked through the mysql.h header file and found entries for initializing and terminating a thread:
Code: Select all
/*
Set up and bring down a thread; these function should be called
for each thread in an application which opens at least one MySQL
connection. All uses of the connection(s) should be between these
function calls.
*/
my_bool STDCALL mysql_thread_init(void);
void STDCALL mysql_thread_end(void);
BINGO!! I thought to myself; just make sure I call that mysql_thread_end() method, and those pesky little threads will go away. Unfortunately, that's not how it's working. So this is obviously something either I'm doing wrong or something wrong in the mysql library, but it boggles my mind that more people aren't running into this.. Or are you running into it and just don't know?
Note one difference between the Borland executable and the Microsoft one is that the Microsoft executable will still close with the running threads, whereas the Borland one won't.
Posted: 30.12.2005, 16:23
by killerjohn
I've the same problem, with WinXP SP2, MySQL 5.0.15 and Delphi 7
But in my VMWare VM (WinXP SP2, MySQL 5.0.15, D7) and on other machines this problem isn't exists...
Posted: 02.01.2006, 19:51
by killerjohn
How can U install Zeos under D2006 ??? I've "invalid pointer operation" message
Posted: 10.01.2006, 13:21
by tygrys
Please check this
forum thread
tygrys