Page 1 of 1

Problem with localfilover and TmyQuery.Execute.

Posted: Wed 25 Apr 2007 23:30
by eduardosic
Hi, i found a small problem.

the TmyQuery.Execute don't reconect on server with localfailover = true and OnLostConnection > RetryMode := TRetryMode( 2 )

with the TMyQuery.Open, all rigth.

the sample demonstrate it.

http://www.drdsistemas.com/util/failover.zip

Posted: Thu 26 Apr 2007 09:59
by Antaeus
I do not have enough privileges to download this archive. Please send it to me at evgeniyd * crlab * com.
Exclude exe file(s) from the archive if it is included.

ok

Posted: Thu 26 Apr 2007 12:11
by eduardosic
Antaeus wrote:I do not have enough privileges to download this archive. Please send it to me at evgeniyd * crlab * com.
Exclude exe file(s) from the archive if it is included.
I finished to send.

Thank's.

Re: ok

Posted: Fri 27 Apr 2007 13:01
by eduardosic
eduardosic wrote:
Antaeus wrote:I do not have enough privileges to download this archive. Please send it to me at evgeniyd * crlab * com.
Exclude exe file(s) from the archive if it is included.
I finished to send.

Thank's.
Antaeus you it received the email with the example?

Posted: Fri 27 Apr 2007 14:09
by Jackson
Currently MyDAC doesn't support reexecuting queries after the connection is lost.
We will add this functionality in the next build of MyDAC 5.

humm

Posted: Fri 27 Apr 2007 17:43
by eduardosic
Jackson wrote:Currently MyDAC doesn't support reexecuting queries after the connection is lost.
We will add this functionality in the next build of MyDAC 5.
Using TMyQuery.Open; the reconnection and reexecution are OK.

Using TMyQuery.Execute; the exception lost connection is raised.

TMyConnection works with
- DisconnectModel
- Pool of conections
- LocalFailOver
and OnLostConnection = ReconnectAndExecute.

thank's

LocalFailOver and Update/Insert without a transaction

Posted: Tue 27 Jul 2010 20:43
by eduardosic
Hi DevArt.

LocailFailOver don't work with a Update or Insert Statment. with Select works fine.. please, fix it. localfailover is a big feature.

Posted: Mon 02 Aug 2010 15:21
by Dimon
To solve the problem you should process the OnConnectionLost event of TMyConnection and set the RetryMode value to rmReconnectExecute, like this:

Code: Select all

procedure TForm1.MyConnectionConnectionLost(Sender: TObject;
  Component: TComponent; ConnLostCause: TConnLostCause; var RetryMode: TRetryMode);
begin
  if ConnLostCause = clExecute then
    RetryMode := rmReconnectExecute;
end;

Posted: Tue 17 Aug 2010 16:40
by eduardosic
Dimon wrote:To solve the problem you should process the OnConnectionLost event of TMyConnection and set the RetryMode value to rmReconnectExecute, like this:

Code: Select all

procedure TForm1.MyConnectionConnectionLost(Sender: TObject;
  Component: TComponent; ConnLostCause: TConnLostCause; var RetryMode: TRetryMode);
begin
  if ConnLostCause = clExecute then
    RetryMode := rmReconnectExecute;
end;
i use

procedure TForm1.MyConnectionConnectionLost(Sender: TObject;
Component: TComponent; ConnLostCause: TConnLostCause; var RetryMode: TRetryMode);
begin
RetryMode := rmReconnectExecute;
end;

But a found the problem. if a have a opened query (select * from) with a property FetchAll = False and try do execute a update and the connection is lost.. a exception is raised and the OnConnectionsLost event is'nt called.

uuf, 1hour to find the problem.

Posted: Wed 18 Aug 2010 09:45
by Dimon
MyDAC help says:
If a connection breaks, a fatal error occurs, and the OnConnectionLost event will be raised if the following conditions are fulfilled:
  • There are no active transactions;
  • There are no opened and not fetched datasets;
  • There are no explicitly prepared datasets or SQLs.

Posted: Wed 18 Aug 2010 13:13
by eduardosic
Dimon wrote:MyDAC help says:
If a connection breaks, a fatal error occurs, and the OnConnectionLost event will be raised if the following conditions are fulfilled:
  • There are no active transactions;
  • There are no opened and not fetched datasets;
  • There are no explicitly prepared datasets or SQLs.
FailOver under a Active Transaction is a Best Feature for MyDAC 6. :roll:

about fetchAll, i remove all fetchall = false in my app

Posted: Wed 18 Aug 2010 13:24
by Dimon
Thank you for your inquiry. We will investigate the possibility of adding this functionality in the future.