Connecting to Postgres -Reconnecting

Stephen Miller stephenmiller1958 at gmail.com
Fri Sep 6 05:12:10 EDT 2019


Hi Guys

Have a look at these functions

https://www.postgresql.org/docs/current/functions-info.html

You can do a lot of powerful things with the PID and others.

On Fri, 6 Sep 2019 at 16:04, Chris Hughes <ataddata at bigpond.net.au> wrote:

> There are 3 areas you can look at.
>
> 1.0 There is a timer in Postgres
> Do tSessionObj.$logontimeout.$assign(680)     ;;Postgres DAM default
> timeout
> is 15 minutes... unbelievable. 480=8 hours
>
> 2.0 Some routers also have a time out.
>
> 3.0 I read in postgres you can check to see if you have a connection is Ok
> by checking for example company details. If found it is ok do nothing, if
> not re run the logon procedure. This is seamless.
>
>
>
> Do LvObject.$GetDataBaseName Returns LvDataBaseName     ;; We check the
> current connection to see if still connected to current database. Otherwise
> we try and reconnect automactically to SQL server.
> If LvDataBaseName=tProject     ;; Data base name
> Calculate tLoginState as kTrue
> Quit method kTrue
> Else     ;; Down this leg we go and do another logon
> Calculate tLoginState as kFalse
> Switch tPlatform
> Case 'postgres'
> Do method $LogonPostgres (,tProject)     ;; Note parameter space.
> Case 'sqlserver'
> Do method $LogonSQLServer (,tProject)     ;; Note parameter space.
> End Switch
> If tLoginState=kFalse
> OK message System Warning (Icon) {This fault indicates the connection the
> SQL server has been lost, problems could be:-//Network Down.//Local Area
> cable unpluged.//Please restart system.}
> Quit all methods
> Else
> Quit method kTrue
> End If
> End If
> Quit method
>
>
> Chris Hughes
>
> Copious Data Pty Ltd (Trading as Atad Data)
> Unit 8 /3460 Pacific Highway
> Springwood QLD 4127
> Phone No:- 07 3208 6347
> Mobile No:- 0409 263 349
> Fax No:- 07 3208 9347
> Email:- ataddata at bigpond.net.au
> Web Site:- http://ataddata.com.au
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: omnisdev-en [mailto:omnisdev-en-bounces at lists.omnis-dev.com] On
> Behalf
> Of Alan Grinberg
> Sent: Friday, 6 September 2019 3:39 PM
> To: OmnisDev List - English
> Subject: Connecting to Postgres -Reconnecting
>
> Hi all,
>
> We have Studio 8.1 on local computers connecting to a PostgreSQL DB
> instance
> on AWS.
>
> At some sites the user may leave the program running and connected
> (normal),
> and go away from their desk for 15 minutes or more.
> When they return the connection has been lost, and they have to Exit and
> sign on again (a pain).
>
> Does anyone know of a way to avoid the lost connection (we have tried
> various computer settings), or is there a way to have it check for a
> connection when the user starts using the program again? Is there overhead
> in checking the connection on each call to the server? It looks like the
> session is lost. Is this in the design of our code or some other issue?
>
> Thanks. Any help would be appreciated.
>
> - Alan
>
>
> ----------------------------------------------------
> Alan Grinberg
> AG Systems/ZOO-INK
> San Francisco, CA
>
> www.zoo-ink.com <applewebdata://69E79D34-B861-4F1A-8A06-ECEE3CCD7D56>
> www.perfectfit.net
> alan at perfectfit.net
> ----------------------------------------------------
>
>
>
>
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
>
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
>


-- 
Kind Regards,

Stephen Miller



More information about the omnisdev-en mailing list