On Tue, 18 Aug 2015, Eric Kom wrote:
Hi Folks,
I got two procedures that are connected to MariaDB 5.6,
My goal is if my application was launch for a long time, it must not lost the
connection with my database and if the connection to the database was lost
due to any reasons and restored (MariaDB running again), the procedure must
still connect to the database without the application been restarted.
You must always be prepared to handle such error conditions.
The connection can go away for several reasons.
So, there is only one way to do what you want:
Catch errors, and analyse the error.
When the error indicates that the database connection was lost, re-initiate the
connection.
There is a special connection.close(force) : if you set force to true,
it will ignore errors that occur during close (the error can happen if the
connection was lost).
Michael.
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus