[Lazarus] TMySQL51Connection: Keep connection alive

Andrey Smyntyna andreysmyntyna at gmail.com
Wed Dec 5 15:20:10 CET 2012


Hello.

I need some explanation of how to do persistent connection to MySQL
database and restore it if it has broken.

In my test project I have created TMySQL51Connection component with
KeepConnection property set to True
and additionaly before making any database operations I check connection
availability like below:

  if not dm.mysql.Connected then
      dm.mysql.Connected := True;

But sometimes I anyway get connection error with the fact that MySQL server
is present and available in network.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20121205/703ced5d/attachment-0002.html>


More information about the Lazarus mailing list