| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
|
| Something like this? INQUIRE_SQL (Li_RtnStatus = errorno, Lv_Msg = errortext); IF Li_RtnStatus = 37000 THEN Lv_Msg = 'Database connection lost. Disconnecting...'; Lv_Database = CurFrame.DbSession.Database; Li_RtnStatus = CurFrame.DbSession.Disconnect(); /* Attempt Re-Connect (3 tries) */ FOR Li_CurRow = 1 to 3 DO Lv_Msg = 'Scheduler: Attempting reconnection in 10 secs...'; SLEEP 10; Li_RtnStatus = CurFrame.DbSession.Connect(database = :Lv_Database); IF Li_RtnStatus = ER_OK THEN -----Original Message----- From: info-ingres-bounces-at-kettleriverconsulting.com [mailto:info-ingres-bounces-at-kettleriverconsulting.com]On Behalf Of simonl-at-unwired.com.au Sent: Thursday, 24 May 2007 6:42 PM To: info-ingres-at-kettleriverconsulting.com Subject: Re: [Info-Ingres] Problem when Ingres server is rebooted My personal favourite way of doing it is to raise a database event before shutting down the server. Your application must listen for the event & then disconnect. Only other problem with this (besides requiring a code change) is you must remember to use some special shutdown command which sends the event to all databases in the installation. If reconnecting is really required, perhaps wait a specified time and then attempt to reconnect. This must be coded for. Cecil Westerhof wrote: > We have a program that uses a remote Ingres database server. When the remote > server reboots the database connection handle is offcourse not valid > anymore. Is there a way to see that the remote server has rebooted? If so > what is the best way to handle this? I suppose a close is not possible > anymore. How do I clear the old handle? And when this is done, can I > reconnect to the rebooted Ingres server? _______________________________________________ Info-Ingres mailing list Info-Ingres-at-kettleriverconsulting.com http://www.kettleriverconsulting.com...fo/info-ingres |
![]() |
| Thread Tools | |
| Display Modes | |