Re-connect

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
b00
Posts: 3
Joined: Fri 15 Dec 2006 12:36

Re-connect

Post by b00 » Fri 15 Dec 2006 12:41

Hello,

I'm having problem with pool of TMyConnection. When server restarts, all subsequent queries start throuw an exception «Lost communication …», altough server already running. What is the best method to automatically re-connect for persistent clients?

Thanks in advance,
b00

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Fri 15 Dec 2006 17:15

You can try do add a handler to the MyConnection.OnError event and check the error code. Error codes are described in the MySQL Reference Manual. In the next (fifth) version of MyDAC we will add enhanced support of connection loss handling (Failover).

Post Reply