[Openroad-users] App Server - Timeout Interval

Gary Hansford gary.Hansford at indesitcompany.com
Tue Oct 2 18:17:56 EST 2007


Jonathon,

   Handling a DBMS connection dropping in an ASO...

   We do this all the time - to allow our backups to get in and do their
work...

   You'll need to create a 4GL proc with code something like this: -

   ------------------------
   l_i_errorno = 0;

   IF Curprocedure.DBSession.State = DS_CONNECTED
   THEN

       // Do some SQL to prove DBMS connection is really OK...

       CurSession.DBMSErrorPrinting = EP_NONE;
       SELECT DBMSINFO('DATABASE') AS :l_v_database;
       INQUIRE_QSL (l_i_errorno = DBMSERROR);
       COMMIT;

       CurSession.DBMSErrorPrinting = EP_OUTPUT
   ENDIF;

   IF Curprocedure.DBSession.State != DS_CONNECTED
   OR l_i_errorno                  != 0
   THEN

       l_i_status = CurProcedure.DBSession.Disconnect();

       l_i_status = CurProcedure.DBSession.Connect(
                           database = :GC_V_DBNAME,
                           flags    = :GC_V_DBFLAGS
                           );

       // if l_i_status != ER_OK - we've had it !!

       l_i_status = YOUR_4GLPROC_WITH_SETUP_SQL(); // e.g. SET
SESSION... lockmode...id...
   ENDIF;
   ------------------------

   After you've created the procedure, you'll need to ensure every SCP
calls this right at the beginning - before any SQL is used. Give your
4GL procedure a meaningful name (e.g Check_Reconnect_DBMS) so its
obvious what its doing there...

   You should also change your standard error handler (invoked after
every SQL statement), to handle a DBMS connection dropped issue - by
returning an error to the front end - BUT resetting the error count and
NOT issuing an EXIT statement...

   Doing this will allow your ASO to continue working with a DBMS
connection problem being invisible to the caller unless it occurs during
an SCP call (in which case the caller will see the error occurring)..

   Hope this makes sense...

   Cheers

Gary


E-Mail Notice and disclaimer.

This e-mail (including any attachment) is intended for the addressee named above. As this e-mail may contain confidential or privileged information, if you are not the named addressee, or the person responsible for delivering the message to the named addressee, please notify us immediately.
Every effort has been made to ensure that this e mail and any attachment is free from viruses but we give no warranty to that effect and can accept no responsibility for any losses resulting from infected e-mail. The internet cannot guarantee the integrity of this message. Indesit Company UK Ltd (and its subsidiaries) shall not be liable for the message if modified. Please note that any views expressed in this e-mail may be those of the author and do not necessarily reflect those of this organisation.
Indesit Company UK Limited
Registered Office: Morley Way, Peterborough, PE2 9JB.
Company Number 106725. EEE Reg. Number WEE/DH0057TS



More information about the Openroad-users mailing list