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

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Rocojo
Posts: 18
Joined: Tue 24 Jan 2006 12:57
Location: Eindhoven, The Netherlands

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

Post by 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.

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by 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.

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

Post by 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

Post by 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

Post Reply