Re: [Lazarus] Is there a way to reconnect to postgresql if the connection fails?

2022-08-24 Thread Luca Olivetti via lazarus

El 17/5/18 a les 9:50, Luca Olivetti via Lazarus ha escrit:

El 15/05/18 a les 21:43, Luca Olivetti via Lazarus ha escrit:

El 15/05/18 a les 21:11, Michael Van Canneyt via Lazarus ha escrit:


I will need to check this, but the purpose of Close(True) is exactly to
ignore errors while closing for a reconnect. It was introduced and 
tested in the case of MySQL, but

normally should work on any database.

Can you please post a small sample program in the bugtracker ?


Done

https://bugs.freepascal.org/view.php?id=33737


I added a couple of comments to that bug (that I cannot reopen).


Bye
--
Luca Olivetti
Wetron Automation Technology http://www.wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Is there a way to reconnect to postgresql if the connection fails?

2022-08-24 Thread Michael Van Canneyt via lazarus




On Wed, 24 Aug 2022, Luca Olivetti via lazarus wrote:


El 17/5/18 a les 9:50, Luca Olivetti via Lazarus ha escrit:

El 15/05/18 a les 21:43, Luca Olivetti via Lazarus ha escrit:

El 15/05/18 a les 21:11, Michael Van Canneyt via Lazarus ha escrit:


I will need to check this, but the purpose of Close(True) is exactly to
ignore errors while closing for a reconnect. It was introduced and tested 
in the case of MySQL, but

normally should work on any database.

Can you please post a small sample program in the bugtracker ?


Done

https://bugs.freepascal.org/view.php?id=33737


I added a couple of comments to that bug (that I cannot reopen).


I reopened it. If you can implement a patch that checks forcedClosed for
postgres, I will be glad to check & apply it...

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Is there a way to reconnect to postgresql if the connection fails?

2022-08-24 Thread Luca Olivetti via lazarus

El 24/8/22 a les 12:50, Michael Van Canneyt ha escrit:



https://bugs.freepascal.org/view.php?id=33737


I added a couple of comments to that bug (that I cannot reopen).


I reopened it. If you can implement a patch that checks forcedClosed for
postgres, I will be glad to check & apply it...



As you can see from the bug report, I tried, I failed, I gave up :-(
I'll use the nuclear option that I used 4 years ago, i.e. brutally close 
the app if the connection to the database is severed, then a watchdog 
app will restart it.
In this case the client app and the postgresql server will run in the 
same pc so it shouldn't be a big issue (crossing fingers).


Bye
--
Luca Olivetti
Wetron Automation Technology http://www.wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Is there a way to reconnect to postgresql if the connection fails?

2022-08-24 Thread Luca Olivetti via lazarus

El 24/8/22 a les 13:15, Luca Olivetti via lazarus ha escrit:

El 24/8/22 a les 12:50, Michael Van Canneyt ha escrit:



https://bugs.freepascal.org/view.php?id=33737


I added a couple of comments to that bug (that I cannot reopen).


I reopened it. If you can implement a patch that checks forcedClosed for
postgres, I will be glad to check & apply it...



As you can see from the bug report, I tried, I failed, I gave up :-(
I'll use the nuclear option that I used 4 years ago, i.e. brutally close 
the app if the connection to the database is severed, then a watchdog 
app will restart it.
In this case the client app and the postgresql server will run in the 
same pc so it shouldn't be a big issue (crossing fingers).


Wait, it seems it's a simple fix. I'll attach a patch later if I see it 
works.


Bye

--
Luca Olivetti
Wetron Automation Technology http://www.wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus