TimeOut problem(s)

Good mornong to all,

my simple application connects to mini server and perform simple query.

Does not matter if the program send request or not, in any case after 1 minute (timeout is set to fefault value = 60000) something happend.

What is append is that after 1 minute (or after timeout limit setted) at the first request (XDataSet.Active:=True after settedt sql string) i got this error

RemoteDB request error:

First chance exception at $BA7E4BE5. Exception class ERemoteDBRequestException with message

http://xxx.xx.xx.xx:3840/tms/remotedb/openfields491



There is a way to have an event that is called before timeout is reached? and what kind of error is the above error ?



Thank's for any reply



Regards

Daniele

Hello Daniele,

Are you sure that is the exact same error?
Your description got me confused, can you please describe the exact steps (and code used) that leads to the error? It's not clear, does the first query performs ok? Or does it take 60s and then raises an error?
Does the error happen client side or server side?

Hi Wagner,

yes the error is exactly as above.

But AFTER readed my post .... i forgot some information, please excuse me.

I try to be more clear.

Server side, mini server application that execute a query, this work witout problem.

Client side, this program is an Android application made with 1 form (mainform), 1 button, 12 tedit, 1 remotedbdatabse, 1 XDataset and 1 tdatetime (in order to choose the date).

When the button is pressed run a procedure where

1) set the connection parameter

2) Set the sql string for first round

3) run sql

4) populate the first 4 tedit

5) Clear xdataset.sql and Set the sql string for second round

6) populate the second 4 tedit

7) Clear xdataset.sql and Set the sql string for last round

6) populate the last4 tedit



The query could be very long (from1 up to 3 minutes depending to the start date, more is away to "today" more is long ) and the first execution is ok.

The first query is runned ok, if i run the query for more than 1 time fast (meaning after update the tedt i click the button another time) the error is raised.

The situation is improved adding XData.active:=False at the end of procedure, but for long query the exception is fired.



The buttonclick is like



procedure TMF.buttonclick(Sender: TObject);

begin

    // Set sqlstring

   ....

   EseguiSQl(SQLString);

// Set TEdit value

....

// Set sqlstring

   ....

    // Set sqlstring

   ....

   EseguiSQl(SQLString);

// Set TEdit value

   ....

   EseguiSQl(SQLString);

// Set TEdit value

   ....

    // Set sqlstring

   ....

   EseguiSQl(SQLString);

// Set TEdit value

XDS1.Active:=False

end;



and EseguiSQL is



function TMF.EseguiSQL(QueryStr: string): Boolean;

begin

Result:=False;

XDS1.Active:=False;

XDS1.SQL.Clear;

XDS1.SQL.Add(QueryStr);

try

    XDS1.Active:=True; // <----- Here the exception when the button is pressed after first time in any button call

except on E: Exception do

    begin

      if (Pos('openfields',E.Message)>0) and (Pos('491',E.Message)>0) then

      begin

        RDB1.Connected:=False;

        ImpostaCredenziali; // Reset the db credential

        RDB1.Connected:=True;

        try

          XDS1.Active:=True; // <---- here never raised exception

        except



        end;

      end

      else

      begin



      end;

    end;

end;

Result:=True;

end;



Last question ....

I try to show a "waiting" message when the button is clicked; To reach this i put a TRect with one label (Please wait...) and TRectangle is not visible (visible:=False).

Procedure is now



procedure TMF.buttonclick(Sender: TObject);

begin

    Rec1.Visible:=True; //<----- Never visible

   // All as above

   Rect1.Visible:=False // <--- because it is visible here ..... but i reset to false ...

end;



Have you any suggestion on how to show this message?

Hope this can be more clear and can help you (exuce me for my bad explanation).



Thank you for any help.



Regards

Daniele

Hi Daniele,

It still doesn't make sense to me, the error message, or the situation. Of course if your query is too long it might be simply a timeout issue.
I would ask you to contact us directly through e-mail sending us a project that reproduces the problem, and/or a video showing what's happening so we have a better idea of what's going on.

Hi Wagner,

i'll send you a simple project.



Thank's for all



Regards

Daniele