Db Connection lost - any notification?

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for SQL Server in Delphi and C++Builder
Post Reply
Dev_Test
Posts: 1
Joined: Thu 04 Dec 2008 15:04

Db Connection lost - any notification?

Post by Dev_Test » Thu 04 Dec 2008 15:22

Hi ,

We are inserting a large volume of records into a SQL server database table using a stored procedure.
The connection is a : TSQLConnection
The stored proc is a : TSQLStoredProc

The problem is as follows: At times the connection to the DB is lost
but the application still shows as being connected.

Is there perhaps some notification event that can be used to send feedback back to the application when a disconnection occurs?

Many thanks.

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

Post by Dimon » Tue 09 Dec 2008 12:32

The TSQLConnection.AfterDisconnect event occurs after the connection is closed by calling the Close method. If the connection was broken, this event is not arised.
dbExpress driver doesn't allow to get information about disconnection occurrence directly. For this you should try to execute any simple query (like "SELECT 1"), and if error is not raised the connection is established.

Post Reply