Re: How to determine if a remote server is up
Posted in 2003
Ortiz Manuel wrote:
> This is a multi-part message in MIME format.
Don't post MIME. One reason I haven't answered before is that I don't
like having to undo MIME.
> I need to save a transaction in two servers from a 4GL application, I
> use the following code:
>
> Insert into database@localserver:tablename values (...)
> Insert into database@remoteserver:tablename values (...)>
> If the remote server is disconnected, how can I avoid the error message
> indicating that couldn't create the lock file, and how can I reduce the
> time for getting this error.
>
> I'm using Informix Online 5.02 with Informix Star
>
> :-)
You shouldn't be using OnLine 5.02; you should be using OnLine 5.20.
OnLine 5.02 is not Y2K-compliant; it has been obsolete since about
1993 - let's grant you an extension to 1995, but still long enough ago
that you should not be using it still.
Which version of I4GL? 4.20? Or 4.10? There are various possibilities.
If you are using I4GL 7.3x, then you could connect separately to each
database, which would give you some confidence about whether they are
up. You'd still do your INSERT operations on a single connection, as
shown, but the fact that you can check your connections separately
would give you confidence that both servers are up.
You can look into environment variables such as INFORMIXCONNTIME and
INFORMIXCONNRETRIES (check spelling!), but I'm not remotely confident
that they apply to 5.02.
If you were using a 7.3x or 9.3x or later server, you could use ER or
HDR in the server to replicate operations.
In 5.0x, you can try using triggers to handle replication, but this is
still prone to taking a long time to detect the absence of the other
server.
--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/