How to detect Connection lost

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
garry
Posts: 7
Joined: Mon 02 Nov 2009 13:24
Location: India
Contact:

How to detect Connection lost

Post by garry » Mon 02 Nov 2009 13:36

Hello

How can i detect whether the connection is lost or not?
I tried with OnConnectionLost event of TMSConnection..but seems not working..is there any prerequisite to activate OnConnectionLost.

Well, My objective to is to detect connection lost so i can stop query operations running timely in my application to avoid unnecessary exceptions.
Thanks

Dimon
Devart Team
Posts: 2885
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Mon 02 Nov 2009 13:52

The OnConnectionLost event is arised when the TMSConnection.Options.LocalFailover property is set to True.

ccmcbride
Posts: 101
Joined: Tue 01 May 2007 16:36

Connection lost

Post by ccmcbride » Mon 14 Dec 2009 19:38

Okay, I set my localFailover = true, but I am getting a ton of errors before the 'onconnectionlost' event is finally hit.
Is there anything else to look at?

I am connected locally, and I am shutting down sqlserver purposely in an attempt to create the error for client sites...
Note : I have autorefresh turned on.

Dimon
Devart Team
Posts: 2885
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Tue 15 Dec 2009 08:01

I can not reproduce the problem. Please try to compose a small sample to demonstrate the problem and send it to dmitryg*devart*com.

Post Reply