Problem with localfilover and TmyQuery.Execute.
-
eduardosic
- Posts: 387
- Joined: Fri 18 Nov 2005 00:26
- Location: Brazil
Problem with localfilover and TmyQuery.Execute.
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
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
-
eduardosic
- Posts: 387
- Joined: Fri 18 Nov 2005 00:26
- Location: Brazil
ok
I finished to send.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.
Thank's.
-
eduardosic
- Posts: 387
- Joined: Fri 18 Nov 2005 00:26
- Location: Brazil
Re: ok
Antaeus you it received the email with the example?eduardosic wrote:I finished to send.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.
Thank's.
-
eduardosic
- Posts: 387
- Joined: Fri 18 Nov 2005 00:26
- Location: Brazil
humm
Using TMyQuery.Open; the reconnection and reexecution are OK.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.Execute; the exception lost connection is raised.
TMyConnection works with
- DisconnectModel
- Pool of conections
- LocalFailOver
and OnLostConnection = ReconnectAndExecute.
thank's
-
eduardosic
- Posts: 387
- Joined: Fri 18 Nov 2005 00:26
- Location: Brazil
LocalFailOver and Update/Insert without a transaction
Hi DevArt.
LocailFailOver don't work with a Update or Insert Statment. with Select works fine.. please, fix it. localfailover is a big feature.
LocailFailOver don't work with a Update or Insert Statment. with Select works fine.. please, fix it. localfailover is a big feature.
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;-
eduardosic
- Posts: 387
- Joined: Fri 18 Nov 2005 00:26
- Location: Brazil
i useDimon 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;
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.
-
eduardosic
- Posts: 387
- Joined: Fri 18 Nov 2005 00:26
- Location: Brazil
FailOver under a Active Transaction is a Best Feature for MyDAC 6.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.
about fetchAll, i remove all fetchall = false in my app