How to check if an informix server is Up
Posted in 2003
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Clustering, Grid & MACH11
This is a multi-part message in MIME format.
------_=_NextPart_001_01C3A3A9.ED851AB8
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
In a 4GL program I need to do an insert in three distinct servers:
=20
...
INSERT INTO db@olserver1.table VALUES (...)
INSERT INTO db@olserver2.table VALUES (...)
INSERT INTO db@olserver3.table VALUES (...).....
=20
When one of this servers is down, the 4GL program wait several minutes
before I got an error message.
=20
How I can check if the server is Up before to do the insert.
=20
It is possible to trap the error setting the timeout shorter.
=20
Thanks
=20
Manuel Ortiz
=20
:-)
=20
------_=_NextPart_001_01C3A3A9.ED851AB8
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns=3D"http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DProgId content=3DWord.Document>
<meta name=3DGenerator content=3D"Microsoft Word 10">
<meta name=3DOriginator content=3D"Microsoft Word 10">
<link rel=3DFile-List href=3D"cid:filelist.xml@01C3A380.0493C3C0">
<!--[if gte mso 9]><xml>
<o:OfficeDocumentSettings>
<o:DoNotRelyOnCSS/>
</o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:SpellingState>Clean</w:SpellingState>
<w:GrammarState>Clean</w:GrammarState>
<w:DocumentKind>DocumentEmail</w:DocumentKind>
<w:HyphenationZone>21</w:HyphenationZone>
<w:EnvelopeVis/>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;
mso-font-charset:2;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:0 268435456 0 0 -2147483648 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;
text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;
text-underline:single;}
span.EstiloCorreo17
{mso-style-type:personal-compose;
mso-style-noshow:yes;
mso-ansi-font-size:10.0pt;
mso-bidi-font-size:10.0pt;
font-family:Arial;
mso-ascii-font-family:Arial;
mso-hansi-font-family:Arial;
mso-bidi-font-family:Arial;
color:windowtext;}
span.GramE
{mso-style-name:"";
mso-gram-e:yes;}
@page Section1
{size:595.3pt 841.9pt;
margin:70.85pt 3.0cm 70.85pt 3.0cm;
mso-header-margin:35.4pt;
mso-footer-margin:35.4pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 10]>
<style>
/* Style Definitions */=20
table.MsoNormalTable
{mso-style-name:"Tabla normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";}
</style>
<![endif]-->
</head>
<body lang=3DES link=3Dblue vlink=3Dpurple =
style=3D'tab-interval:35.4pt'>
<div class=3DSection1>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'>In a 4GL program I =
need to do
an insert in three distinct servers:<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'><o:p> </o:p></span=
></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'>…<o:p></o:p></spa=
n></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'>INSERT INTO =
db@olserver1.table
VALUES (…)<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'>INSERT INTO =
db@olserver2.table
VALUES (…)<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'>INSERT INTO =
db@olserver3.table
VALUES (…)<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'>…..<o:p></o:p></s=
pan></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'><o:p> </o:p></span=
></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'>When one of this =
servers is
down, the 4GL program wait several minutes before I got an error =
message.<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'><o:p> </o:p></span=
></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'>How I can check if the =
server
is <span class=3DGramE>Up</span> before to do the =
insert.<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'><o:p> </o:p></span=
></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'>It is possible to trap =
the
error setting the timeout shorter.<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'><o:p> </o:p></span=
></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-langua
On Wed, 05 Nov 2003 09:34:32 -0500, Ortiz Manuel wrote:
This kind of delay happens when the target server's machine is online but the
Informix engine is not. Try setting and exporting the following in the
program's environment:
INFORMIXCONTIME=5
INFORMIXCONRETRY=2
The 4GL library will try to connect twice within 5 seconds and return an error
if it fails. These variables enable a local alarm mechanism which is more
responsive than waiting for the remote machine's TCP stack to timeout.
Art S. Kagel
> This is a multi-part message in MIME format.
>
> ------_=_NextPart_001_01C3A3A9.ED851AB8
> Content-Type: text/plain;
> charset="us-ascii"
> Content-Transfer-Encoding: quoted-printable
>
> In a 4GL program I need to do an insert in three distinct servers: =20 ...
> INSERT INTO db@olserver1.table VALUES (...) INSERT INTO db@olserver2.table
> VALUES (...) INSERT INTO db@olserver3.table VALUES (...) ..... =20 When one of> this servers is down, the 4GL program wait several minutes before I got an
> error message.
> =20
> How I can check if the server is Up before to do the insert. =20 It is
> possible to trap the error setting the timeout shorter. =20 Thanks =20
> Manuel Ortiz
> =20
> :-)
> =20
>
> ------_=_NextPart_001_01C3A3A9.ED851AB8
> Content-Type: text/html;
> charset="us-ascii"
> Content-Transfer-Encoding: quoted-printable
>
> <html xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
> xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
> xmlns=3D"http://www.w3.org/TR/REC-html40">
>
> <head>
> <meta http-equiv=3DContent-Type content=3D"text/html; = charset=3Dus-ascii">
> <meta name=3DProgId content=3DWord.Document> <meta name=3DGenerator
> content=3D"Microsoft Word 10"> <meta name=3DOriginator content=3D"Microsoft
> Word 10"> <link rel=3DFile-List href=3D"cid:filelist.xml@01C3A380.0493C3C0">
> <!--[if gte mso 9]><xml>
> <o:OfficeDocumentSettings>
> <o:DoNotRelyOnCSS/>
> </o:OfficeDocumentSettings>
> </xml><![endif]--><!--[if gte mso 9]><xml>
> <w:WordDocument>
> <w:SpellingState>Clean</w:SpellingState>
> <w:GrammarState>Clean</w:GrammarState>
> <w:DocumentKind>DocumentEmail</w:DocumentKind>
> <w:HyphenationZone>21</w:HyphenationZone> <w:EnvelopeVis/> <w:Compatibility>
> <w:BreakWrappedTables/>
> <w:SnapToGridInCell/>
> <w:WrapTextWithPunct/>
> <w:UseAsianBreakRules/>
> </w:Compatibility>
> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
> </w:WordDocument>
> </xml><![endif]-->
> <style>
> <!--
> /* Font Definitions */
> @font-face
> {font-family:Wingdings;
> panose-1:5 0 0 0 0 0 0 0 0 0;
> mso-font-charset:2;
> mso-generic-font-family:auto;
> mso-font-pitch:variable;
> mso-font-signature:0 268435456 0 0 -2147483648 0;}
> /* Style Definitions */
> p.MsoNormal, li.MsoNormal, div.MsoNormal
> {mso-style-parent:"";
> margin:0cm;
> margin-bottom:.0001pt;
> mso-pagination:widow-orphan;
> font-size:12.0pt;
> font-family:"Times New Roman";
> mso-fareast-font-family:"Times New Roman";}
> a:link, span.MsoHyperlink
> {color:blue;
> text-decoration:underline;
> text-underline:single;}
> a:visited, span.MsoHyperlinkFollowed
> {color:purple;
> text-decoration:underline;
> text-underline:single;}
> span.EstiloCorreo17
> {mso-style-type:personal-compose;
> mso-style-noshow:yes;
> mso-ansi-font-size:10.0pt;
> mso-bidi-font-size:10.0pt;
> font-family:Arial;
> mso-ascii-font-family:Arial;
> mso-hansi-font-family:Arial;
> mso-bidi-font-family:Arial;
> color:windowtext;}
> span.GramE
> {mso-style-name:"";
> mso-gram-e:yes;}
> @page Section1
> {size:595.3pt 841.9pt;
> margin:70.85pt 3.0cm 70.85pt 3.0cm;
> mso-header-margin:35.4pt;
> mso-footer-margin:35.4pt;
> mso-paper-source:0;}
> div.Section1
> {page:Section1;}
> -->
> </style>
> <!--[if gte mso 10]>
> <style>
> /* Style Definitions */=20
> table.MsoNormalTable
> {mso-style-name:"Tabla normal";
> mso-tstyle-rowband-size:0;
> mso-tstyle-colband-size:0;
> mso-style-noshow:yes;
> mso-style-parent:"";
> mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
> mso-para-margin:0cm;
> mso-para-margin-bottom:.0001pt;
> mso-pagination:widow-orphan;
> font-size:10.0pt;
> font-family:"Times New Roman";}
> </style>
> <![endif]-->
> </head>
>
> <body lang=3DES link=3Dblue vlink=3Dpurple = style=3D'tab-interval:35.4pt'>
>
> <div class=3DSection1>
>
> <p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
> style=3D'font-size:
> 10.0pt;font-family:Arial;mso-ansi-language:EN-US'>In a 4GL program I = need to
> do
> an insert in three distinct servers:<o:p></o:p></span></font></p>
>
> <p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
> style=3D'font-size:
> 10.0pt;font-family:Arial;mso-ansi-language:EN-US'><o:p> </o:p></span=
>></font></p>
>
> <p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
> style=3D'font-size:
> 10.0pt;font-family:Arial;mso-ansi-language:EN-US'>…<o:p></o:p></spa=
> n></font></p>
>
> <p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
> style=3D'font-size:
> 10.0pt;font-family:Arial;mso-ansi-language:EN-US'>INSERT INTO =
> db@olserver1.table
> VALUES (…)<o:p></o:p></span></font></p>
>
> <p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
> style=3D'font-size:
> 10.0pt;font-family:Arial;mso-ansi-language:EN-US'>INSERT INTO =
> db@olserver2.table
> VALUES (…)<o:p></o:p></span></font></p>
>
> <p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
> style=3D'font-size:
> 10.0pt;font-family:Arial;mso-ansi-language:EN-US'>INSERT INTO =
> db@olserver3.table
> VALUES (…)<o:p></o:p></span></font></p>
>
> <p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
> style=3D'font-size:
> 10.0pt;font-family:Arial;mso-ansi-language:EN-US'>…..<o:p></o:p></s=
> pan></font></p>
>
> <p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
> style=3D'font-size:
> 10.0pt;font-family:Arial;mso-ansi-language:EN-US'><o:p> </o:p></span=
>></font></p>
>
> <p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
> style=3D'font-size:
> 10.0pt;font-family:Arial;mso-ansi-language:EN-US'>When one of this = servers
> is
> down, the 4GL program wait several minutes before I got an error =
> message.<o:p></o:p></span></font></p>
>
> <p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
> style=3D'font-size:
> 10.0pt;font-family:Arial;mso-ansi-language:EN-US'><o:p> </o:p></span=
>></font></p>
>
> <p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
> style=3D'font-size:
> 10.0pt;font-family:Arial;mso-ansi-language:EN-US'>How I can check if the =
> server
> is <span class=3DGramE>Up</span> before to do the =@@NL@