MyConnection->Connect()........ hang until connected...

MyConnection->Connect()........ hang until connected...

Postby Rocojo » Fri 27 Jan 2006 11:25

I've a problem.

I am building an DLL (with borland c++ builder 6) witch contains a MyConnection, MyQuery and a MyTable.

Everithing is working fine but there is only one big problem....

when i try to connect with a mysql server in a network my whole program hangs and waits until the connection is established..... I want to keep the program running.... Can i put this (MyConnection->Connect()) into a thread? How can i do this......... i tried this already but the program is still hanging until connected...

Could somebody help me.
Rocojo
 
Posts: 18
Joined: Tue 24 Jan 2006 12:57
Location: Eindhoven, The Netherlands

Postby Ikar » Tue 31 Jan 2006 07:41

MySQL API doesn't allow asynchronous connection. Your apllication should create additional thread to establish connection and watch it so that other threads don't try to perform requests through the MyConnection.
Ikar
 
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Postby Rocojo » Tue 31 Jan 2006 15:17

thank you for your reaction, we are trying to put everything into Threads... but the problem is that we have several functions to execute in the dll....

so its not easy...
Rocojo
 
Posts: 18
Joined: Tue 24 Jan 2006 12:57
Location: Eindhoven, The Netherlands

Postby Rocojo » Wed 01 Feb 2006 10:00

I solved the problem.. i put the myconnection->connect() into a thread and now its perfetc. i am going to implement a callback function so the software nows when i om ready to receive or send...

very goor
Rocojo
 
Posts: 18
Joined: Tue 24 Jan 2006 12:57
Location: Eindhoven, The Netherlands


Return to MySQL Data Access Components