Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 8 of 8 total
Thread Terminating client app safely after server disconnection
Thu, May 14 2009 2:50 AMPermanent Link

Norman Rorke
Please help !

I'm trying to come up with some way of elegantly termination the client
application when a DBIsam Server disconnection is detected.

I have a timed interrupt in the client app that pings the server every
50 secs to check that the connection is still ok. If no response is
received from the server (e.g. the user machine has just come out of
hibernation that was invoked while the application was running and the
server has killed the connection) I display an appropriate message that
tells the user about the disconnection and that "the application will
now be terminated".

That all works well except that I don't know how to terminate my
application without repeated OS messages popping up, forcing the user to
revert to termination via the Task Manager.

Can anybody provide some guidance in this area ?
TIA



Norman Rorke
norman.r@desktopfinancials.com
Thu, May 14 2009 8:57 AMPermanent Link

David Puett
Application.terminate;

On 5/14/09 2:50 AM, in article
FAD5D343-DD40-4620-84EA-AB8D07B35CAD@news.elevatesoft.com, "Norman Rorke"
<norman.r@desktopfinancials.com> wrote:

> Please help !
>
> I'm trying to come up with some way of elegantly termination the client
> application when a DBIsam Server disconnection is detected.
>
> I have a timed interrupt in the client app that pings the server every
> 50 secs to check that the connection is still ok. If no response is
> received from the server (e.g. the user machine has just come out of
> hibernation that was invoked while the application was running and the
> server has killed the connection) I display an appropriate message that
> tells the user about the disconnection and that "the application will
> now be terminated".
>
> That all works well except that I don't know how to terminate my
> application without repeated OS messages popping up, forcing the user to
> revert to termination via the Task Manager.
>
> Can anybody provide some guidance in this area ?
> TIA
>
>
>
> Norman Rorke
> norman.r@desktopfinancials.com

Thu, May 14 2009 10:43 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

David


He said "elegantly" which is why I didn't suggest the nuclear bomb approach Smiley

Roy Lambert
Thu, May 14 2009 2:45 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Norman,

<< I'm trying to come up with some way of elegantly termination the client
application when a DBIsam Server disconnection is detected.

I have a timed interrupt in the client app that pings the server every 50
secs to check that the connection is still ok. If no response is received
from the server (e.g. the user machine has just come out of hibernation that
was invoked while the application was running and the server has killed the
connection) I display an appropriate message that
tells the user about the disconnection and that "the application will now be
terminated".

That all works well except that I don't know how to terminate my application
without repeated OS messages popping up, forcing the user to revert to
termination via the Task Manager. >>

Are you using DBISAM 4.x ?  If so, the just enabling pinging for the remote
session by setting the TDBISAMSession.RemotePing property to True.

Then, make sure that there is an TApplication-level exception handler
defined and hooked up, and then look for an EDBISAMEngineError exception in
the exception handler.  If the ErrorCode for the EDBISAMEngineError is:

  DBISAM_REMOTECONNECT = 11280;

then set an application-level Boolean flag that indicates that a
reconnection attempt failed, and then check this flag in an
OnRemoteReconnect event handler for the TDBISAMSession component that you're
using.  If the flag is set, then set the Continue var parameter to False and
the StopAsking var parameter to True.  That will allow your application to
shut down normally without all of the reconnection error messages.

--
Tim Young
Elevate Software
www.elevatesoft.com

Thu, May 14 2009 5:16 PMPermanent Link

Norman Rorke
David,

Unfortunately it's not that easy.

Terminate tries to do some cleaning up, which also includes attempts to
close existing connections etc. Because the connection to the server is
no longer there this results in a multitude of exceptions, hence the OS
messages.

Norman

David Puett wrote:
> Application.terminate;
>
> On 5/14/09 2:50 AM, in article
> FAD5D343-DD40-4620-84EA-AB8D07B35CAD@news.elevatesoft.com, "Norman Rorke"
> <norman.r@desktopfinancials.com> wrote:
>
>> Please help !
>>
>> I'm trying to come up with some way of elegantly termination the client
>> application when a DBIsam Server disconnection is detected.
>>
>> I have a timed interrupt in the client app that pings the server every
>> 50 secs to check that the connection is still ok. If no response is
>> received from the server (e.g. the user machine has just come out of
>> hibernation that was invoked while the application was running and the
>> server has killed the connection) I display an appropriate message that
>> tells the user about the disconnection and that "the application will
>> now be terminated".
>>
>> That all works well except that I don't know how to terminate my
>> application without repeated OS messages popping up, forcing the user to
>> revert to termination via the Task Manager.
>>
>> Can anybody provide some guidance in this area ?
>> TIA
>>
>>
>>
>> Norman Rorke
>> norman.r@desktopfinancials.com
>
>
Fri, May 15 2009 2:43 AMPermanent Link

Uli Becker
Tim
> Are you using DBISAM 4.x ?  If so, the just enabling pinging for the remote
> session by setting the TDBISAMSession.RemotePing property to True.

Is there en equivalent for EDB?

Uli
Fri, May 15 2009 7:55 AMPermanent Link

Norman Rorke
Tim,

That works perfectly. Thank you very much.


Norman


Tim Young [Elevate Software] wrote:
> Norman,
>
> << I'm trying to come up with some way of elegantly termination the client
> application when a DBIsam Server disconnection is detected.
>
>  I have a timed interrupt in the client app that pings the server every 50
> secs to check that the connection is still ok. If no response is received
> from the server (e.g. the user machine has just come out of hibernation that
> was invoked while the application was running and the server has killed the
> connection) I display an appropriate message that
> tells the user about the disconnection and that "the application will now be
> terminated".
>
> That all works well except that I don't know how to terminate my application
> without repeated OS messages popping up, forcing the user to revert to
> termination via the Task Manager. >>
>
> Are you using DBISAM 4.x ?  If so, the just enabling pinging for the remote
> session by setting the TDBISAMSession.RemotePing property to True.
>
> Then, make sure that there is an TApplication-level exception handler
> defined and hooked up, and then look for an EDBISAMEngineError exception in
> the exception handler.  If the ErrorCode for the EDBISAMEngineError is:
>
>    DBISAM_REMOTECONNECT = 11280;
>
> then set an application-level Boolean flag that indicates that a
> reconnection attempt failed, and then check this flag in an
> OnRemoteReconnect event handler for the TDBISAMSession component that you're
> using.  If the flag is set, then set the Continue var parameter to False and
> the StopAsking var parameter to True.  That will allow your application to
> shut down normally without all of the reconnection error messages.
>
Fri, May 15 2009 11:01 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Uli,

<< Is there en equivalent for EDB? >>

Sure, the TEDBSession.RemotePing property.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image