Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.


Welcome, Guest
Guest Settings
Help

Thread: Firedac - Timeout expired


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


Permlink Replies: 9 - Last Post: Mar 21, 2017 8:55 AM Last Post By: Lajos Juhasz Threads: [ Previous | Next ]
Barry Wood

Posts: 56
Registered: 9/3/01
Firedac - Timeout expired  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 3, 2017 1:32 AM
Hi I have an application in XE5 that works fine connecting to a MS SQL database.

However, I now have Delphi 10 and the same application (which I've ported over) is working fine on my development machine, but at my clients site it is giving a 'Exception EMSSQLNativeException ... Timeout expired' error message.

I've looked this up in the Embarcadero DocWiki but find no help in explain what causes this error, or how it can be resolved. It now seems that there is a difference in what connectivity Firedac uses (ODBC driver version, for instance), but I can't find anything definitive about this and so far nothing I 've done has helped. Surely if Delphi10/Firedac changes how it connects to MS SQL it should be documented somewhere?

Later: I've found a reference to Lockwait in UpdateOptions of the TFDConnection. This defaults to False which (as I read it) returns the error message if it can't immediately get the record it wants (maybe someone else has hold of it). I'm not sure this could be the problem as on my machine I never get the problem, only on my clients machine. And no one else will be accessing the records. However, might this be a solution?

Edited by: Barry Wood on Mar 3, 2017 1:47 AM
Robert Triest

Posts: 612
Registered: 3/24/05
Re: Firedac - Timeout expired  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 3, 2017 1:54 AM   in response to: Barry Wood in response to: Barry Wood
Do you also see that a record in the database is indeed locked
and if you go to the record with the official MSSQL manager, you can't edit the record either?
Barry Wood

Posts: 56
Registered: 9/3/01
Re: Firedac - Timeout expired  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 5, 2017 8:54 AM   in response to: Robert Triest in response to: Robert Triest
Robert Triest wrote:
Do you also see that a record in the database is indeed locked
and if you go to the record with the official MSSQL manager, you can't edit the record either?

Hi
No the record isn't locked in the database. I can edit it via Management Studio.
What I've found subsequently is that I had a mapping set for Widestring to DateTime. I took that off and the application works fine, so I guess that setting was holding things up.
Dmitry Arefiev

Posts: 1,375
Registered: 12/7/03
Re: Firedac - Timeout expired  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 5, 2017 9:24 PM   in response to: Barry Wood in response to: Barry Wood
First check, that ResourceOptions.CmdExecTimeout has default value (4294967295).

Then provide environment reports for your dev and client workstations:
http://docwiki.embarcadero.com/RADStudio/Berlin/en/DBMS_Environment_Reports_(FireDAC)):

And provide a trace file from your client workstation. But try to minimize the output.
http://docwiki.embarcadero.com/RADStudio/Berlin/en/Tracing_and_Monitoring_(FireDAC)

--
With best regards,
Dmitry
Barry Wood

Posts: 56
Registered: 9/3/01
Re: Firedac - Timeout expired  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 13, 2017 8:40 AM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
Dmitry,

ResourceOptions.CmdExecTimeOut is set at the figure you mention.

The first url you give for environment reports gives a blank page in the docwiki?

Barry

Dmitry Arefiev wrote:
First check, that ResourceOptions.CmdExecTimeout has default value (4294967295).

Then provide environment reports for your dev and client workstations:
http://docwiki.embarcadero.com/RADStudio/Berlin/en/DBMS_Environment_Reports_(FireDAC)):

And provide a trace file from your client workstation. But try to minimize the output.
http://docwiki.embarcadero.com/RADStudio/Berlin/en/Tracing_and_Monitoring_(FireDAC)

--
With best regards,
Dmitry
Dmitry Arefiev

Posts: 1,375
Registered: 12/7/03
Re: Firedac - Timeout expired  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 13, 2017 10:17 AM   in response to: Barry Wood in response to: Barry Wood
The link is between double stars:
**http://docwiki.embarcadero.com/RADStudio/Berlin/en/DBMS_Environment_Reports_(FireDAC)**

--
With best regards,
Dmitry
Barry Wood

Posts: 56
Registered: 9/3/01
Re: Firedac - Timeout expired  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 13, 2017 11:21 AM   in response to: Dmitry Arefiev in response to: Dmitry Arefiev
Dmitry,

Trying to get the report. Docwiki (on your corrected url) shows this code to place behind a button:

procedure TMainForm.Button1Click(Sender: TObject);
begin
FDConnection1.GetInfoReport(mmInfo.Lines);
end;

But that code gives an error. I imagine if I want to be able to get a report from the Client I'll need this to work and produce some output?

Dmitry Arefiev wrote:
The link is between double stars:
**http://docwiki.embarcadero.com/RADStudio/Berlin/en/DBMS_Environment_Reports_(FireDAC)**

--
With best regards,
Dmitry

Edited by: Barry Wood on Mar 13, 2017 11:21 AM
Lajos Juhasz

Posts: 705
Registered: 3/14/14
Re: Firedac - Timeout expired [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 13, 2017 11:49 PM   in response to: Barry Wood in response to: Barry Wood
Barry Wood wrote:

Dmitry,

Trying to get the report. Docwiki (on your corrected url) shows this
code to place behind a button:

procedure TMainForm.Button1Click(Sender: TObject);
begin
FDConnection1.GetInfoReport(mmInfo.Lines);
end;

But that code gives an error. I imagine if I want to be able to get a
report from the Client I'll need this to work and produce some output?

Dmitry Arefiev wrote:
The link is between double stars:
**http://docwiki.embarcadero.com/RADStudio/Berlin/en/DBMS_Environment_Reports_(FireDAC)**

--
With best regards,
Dmitry

Edited by: Barry Wood on Mar 13, 2017 11:21 AM

Barry you should turn to be a politician. In order to get some help you
must give to us enough detail. What is exactly mmInfo? What kind of
errors you get with your code?

I have started a new project. Dropped and configured a TFDConnection,
FDGUIxWaitCursor1 and an TFDPhysODBCDriverLink. Added a TButton with
the following code:

procedure TForm2.Button2Click(Sender: TObject);
var llist: TStringList;
begin
  llist:=Tstringlist.create;
  try
    FDConnection1.GetInfoReport(llist);
    ShowMessage(llist.Text);
  finally
    llist.Free;
  end;
end;


It just works without an error message.
Barry Wood

Posts: 56
Registered: 9/3/01
Re: Firedac - Timeout expired [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 20, 2017 12:27 PM   in response to: Lajos Juhasz in response to: Lajos Juhasz
Hi Lajos,

Thanks for helping out. The code you provided works perfectly, so many thanks.

My issue that I mentioned is that the code shown in the docwiki (which I copied) does not work. The 'mmInfo.lines' isn't my name, it's what is in the docwiki code.

Regards your comment about being a politician - no way, I prefer to stay honest :-)

Lajos Juhasz wrote:
Barry Wood wrote:

Dmitry,

Trying to get the report. Docwiki (on your corrected url) shows this
code to place behind a button:

procedure TMainForm.Button1Click(Sender: TObject);
begin
FDConnection1.GetInfoReport(mmInfo.Lines);
end;

But that code gives an error. I imagine if I want to be able to get a
report from the Client I'll need this to work and produce some output?

Dmitry Arefiev wrote:
The link is between double stars:
**http://docwiki.embarcadero.com/RADStudio/Berlin/en/DBMS_Environment_Reports_(FireDAC)**

--
With best regards,
Dmitry

Edited by: Barry Wood on Mar 13, 2017 11:21 AM

Barry you should turn to be a politician. In order to get some help you
must give to us enough detail. What is exactly mmInfo? What kind of
errors you get with your code?

I have started a new project. Dropped and configured a TFDConnection,
FDGUIxWaitCursor1 and an TFDPhysODBCDriverLink. Added a TButton with
the following code:

procedure TForm2.Button2Click(Sender: TObject);
var llist: TStringList;
begin
  llist:=Tstringlist.create;
  try
    FDConnection1.GetInfoReport(llist);
    ShowMessage(llist.Text);
  finally
    llist.Free;
  end;
end;


It just works without an error message.
Lajos Juhasz

Posts: 705
Registered: 3/14/14
Re: Firedac - Timeout expired [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 21, 2017 8:55 AM   in response to: Barry Wood in response to: Barry Wood
Barry Wood wrote:

Hi Lajos,

Thanks for helping out. The code you provided works perfectly, so
many thanks.

My issue that I mentioned is that the code shown in the docwiki
(which I copied) does not work. The 'mmInfo.lines' isn't my name,
it's what is in the docwiki code.

Most probably mmInfo is a TMemo on the form. I agree that they should
mention that you have to add a memo and name it mmInfo. The error
message and the name should suggest that you have to add some component
that has a lines property :).
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02