Handle leaks...Multithreading

This is a discussion on Handle leaks...Multithreading within the MySQL Database forums, part of the Database Forums category; Hello world, I have problems to connect to an MySQL server via ODBC Connector 3.51.23 and Cherry City ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-16-2008
wolters@xgraphic.de
 
Posts: n/a
Default Handle leaks...Multithreading

Hello world,

I have problems to connect to an MySQL server via
ODBC Connector 3.51.23 and
Cherry City Software MySQL OLE DB Provider respectively.

There seems to be a handle leak if I open/close the db
connection from a worker thread. (Windows Task Manager shows
that for every database connection two more handles are
needed.)


I have attached a small test program which shows this
problem. (The database connections are created inside the
worker threads because the db user names and passwords
are constantly changing. In my "real" project it's possible
to have up to 10 parallel threads connecting to the
server.)


Please... help...


Best regards,
M. Wolters

-=-=-=-=-=-=-=-=-=-


unsigned int MyThread(void*)
{
std::cout << "Open... ";
CDatabase db;
db.OpenEx("DSN=MyDSN;UID=tilli;PWD=tilli", 0);
db.Close();
std::cout << "Close...\n";


return 0;



}


int main()
{
VERIFY(AfxWinInit(GetModuleHandle(0), 0, GetCommandLine(), 0));

for(int i=0; i<500; ++i)
{
std::cout << i << "\n";
AfxBeginThread(MyThread, 0);
Sleep(2500);
}


return 0;



Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:13 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0