Hi Knut,
Thanks for your answer. We are experiencing disconnections to the database caused not so much by timeouts, but by minor disruptions in the network. As a result, the connection is broken but Uniface thinks the connection is still there.
We use a sql query, just like yours, to check if there still is a connection. If that returns a negative $status, we use the open statement to open the path to the database again.
Unfortunately, sometimes Uniface shows the path credentials popup when the sql statement is executed.
If we then try to skip the sql and go for the open statement, Uniface crashes.
Maybe someting for the Uniface wishlist.
------------------------------
Peter Lammersma
Coöperatie Unividuals Application Management
Amsterdam NL
------------------------------
Original Message:
Sent: 04-15-2023 15:34
From: Knut Dybendahl
Subject: Is there a way check if a path is already open?
Hey Peter,
Our db connection times out (from the db side) after 30 minutes.
I'm using a
sql/data "select sysdate from dual","$DEF" from our three main activation routines - in other words -
the connection(s) were established at logon - then they might 'die' whilst the user is busy doing
non-db work.
The usysidx does NOT pop - I simply get a $status < 0 - thus I know the connection is dead...
Hope this helps.
Knut
------------------------------
Knut Dybendahl
Original Message:
Sent: 04-13-2023 06:24
From: Peter Lammersma
Subject: Is there a way check if a path is already open?
Hi all,
A question that brings me back to my first Uniface experience and the miraculous way Uniface opened a path to the database, both explicitly (with the open statement) and implicitly (as soon as needed with info from the asn). But what if we are not sure about the status of the connection to a path? Is there a way to find out if the path is opened already?
What I have tried so far:
1. Do some IO to the database. Unfortunately this activates the credentials popup. We don't want that to happen.
2. Use $user and/or $password. These will only have a value if the path credentials are available. Unfortunately they seems to crash Uniface is the path not opened yet.
3. Just do an 'open' statement. This is how it's done most of the times. The open statement does an implicit close of the path if it was already open.
I wished there was a function to return the status of a path. Or is there such?
------------------------------
Peter Lammersma
Coöperatie Unividuals Application Management
Amsterdam NL
------------------------------