Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.

Welcome, Guest
Guest Settings

Thread: FireDAC, TClientDataset and Timeout

This question is not answered. Helpful answers available: 2. Correct answers available: 1.

Permlink Replies: 0
Anders Gustavsson

Posts: 26
Registered: 9/26/99
FireDAC, TClientDataset and Timeout  
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 17, 2017 2:41 AM
I have been struggling with the handling of timeout from the database. This is my setup:

Connection definition parameters
FireDAC info
Tool = RAD Studio 10.1 Berlin
FireDAC = 15.0.1 (Build 86746)
Platform = Windows 32 bit
Client info
Loading driver MSSQL ...
Loading odbc32.dll driver manager
Creating ODBC environment handle
Searching for ODBC driver ...
Checking for ODBC driver [SQL SERVER NATIVE CLIENT 11.0] ...
Found [SQL Server Native Client 11.0]
Driver Manager version = 03.81.9600.0000
Session info
Checking session ...
Warning: SQL NC 2012 and MS ODBC 11 fail to work with TVP.
Current catalog =
Current schema = dbo
Driver name = sqlncli11.dll
Driver version = 11.00.6518
Driver conformance = 3
DBMS name = Microsoft SQL Server
DBMS version = 12.00.2269

I set a rather low value to CommanExecution TimeOut, to test how this could be handled. From SSMS I block a table and from my program I try to send an update via TClientDataset.ApplyUpdates. After the set time, this of course fails. The interesting thing here is that the OnReconcileError event on the clientdataset is not called, as it used to be when we used another database with it's own connection components. And if that is not called, I really don't know what has happened.

Digging a bit deeper I see that the error code returned from FireDAC is zero. I tested this with setting a breakpoint in TFDDBError.Create when the timeout comes. If I here in the debugger set AErrorCode value to something > 0 the OnReconcileError is really called. (The error message is "SQL state: HYT00. Native error: 0. Error message: '#$D#$A'[Microsoft][SQL Server Native Client 11.0]Query timeout expired")

I guess there is some kind of philosophy behind this, but I don't understand it and would be happy to know about it. And I would of course like a way to go around the problem :-)

Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02