TMyConnection.Connect and PerformConnect method

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ConBran
Posts: 4
Joined: Wed 28 Aug 2013 17:20

TMyConnection.Connect and PerformConnect method

Post by ConBran » Tue 22 Sep 2015 16:57

Hi,

I am trying to get to the root of an issue where the connection time_zone is being reset to SYSTEM (as opposed to user defined).

I have some custom code in the 'PerformConnect' method to check for a custom property and, if set, to execute the SET TIME_ZONE query in MySQL.

I just need to know if PerformConnect is called when the connection is lost to the MySQL server and is automatically reconnected?

The TMyConnection component is basically set to all defaults except for LoginPrompt, which is set to false. The version I am using is MyDAC for Rad Studio XE3 (I believe it's 6.3.4).

Thanks!

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: TMyConnection.Connect and PerformConnect method

Post by ViktorV » Wed 23 Sep 2015 08:29

To resume lost connection, you should use the TMyConnection.OnConnectionLost event handler. For more information, please read the MyDAC documentation: http://www.devart.com/mydac/docs/?devar ... onlost.htm
When using the TMyConnection.OnConnectionLost event handler, the TCustomDAConnection.PerformConnect method is not called, but an internal method is called for resuming connection.

Post Reply