[Lazarus] Connection lost after a long inactivity with my Lazarus Application using MySQL/MariaDB;

ERICK VAN ZYL erick.vanzyl83 at gmail.com
Sun Dec 28 18:23:54 CET 2014


On 28 December 2014 at 17:18, Michael Van Canneyt <michael at freepascal.org>
wrote:

>
>
> On Sun, 28 Dec 2014, ERICK VAN ZYL wrote:
>
>  Good day all,
>>
>> I'm new like Databases in Lazarus,
>>
>> I have noticed a connection problem while using my Lazarus application
>> with database like MySQL/MariaDB; after a long inactivity with my Lazarus
>> Application using MySQL, the application lost a connection with the
>> database until
>> I have to restart the apps. Even after opened and closed the connection,
>> It that’s not work until I have to restart the apps.
>>
>> If I used another database like SQLite, the problem didn't occur (I don't
>> have to restart the Apps for further DB request).
>>
>> Can any one assist me regarding this issue?
>>
>
> There is no proper solution for this. This is the mysql client engine that
> throws this error.
>
Thanks Michael.

>
> We have created a helper workaround for this in TSQLConnection:
> procedure Close(ForceClose: Boolean=False);
> Using this, you can forcedly close the connection.
>
I will try it.
Beside been Non-Visual component (TSQLConnection), what is the difference
between the TSQLConnection and TSQLConnector?


> this allows you to catch the mysql error, close and re-open the connection.
>


>
> Michael.
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20141228/c707a59e/attachment-0003.html>


More information about the Lazarus mailing list