Failoverpartner

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Freerk
Posts: 3
Joined: Fri 23 Jan 2009 17:38

Failoverpartner

Post by Freerk » Fri 21 Aug 2009 13:54

Hello,

We are trying to get failover partner to work using SQL server 2008 and sql native client.
We have tried anything, but SDac doesn't reconnect correctly when it fails over to the other server.
It keeps trying to connect the "old" sqlserver
Any tips?


Regards,
Freerk Jelsma
SchoolMaster BV

Dimon
Devart Team
Posts: 2888
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Tue 25 Aug 2009 14:44

Please, try to compose a small sample to demonstrate the problem and send it to dmitryg*devart*com.

rwright
Posts: 5
Joined: Wed 17 Sep 2008 19:53

Post by rwright » Mon 12 Oct 2009 15:01

Dimon wrote:Please, try to compose a small sample to demonstrate the problem and send it to dmitryg*devart*com.
Did you get an example? What was the resolution?

Thanks!

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Fri 16 Oct 2009 10:50

We did not recieve your sample. Please send it to support * devart * com once more.

rwright
Posts: 5
Joined: Wed 17 Sep 2008 19:53

Re: Failoverpartner

Post by rwright » Fri 09 Dec 2011 15:45

I am having this issue, any resolution?

More information:

We created a small app that loops and adds a row to a table.

dmCore.MSSQL.SQL.Clear;
dmCore.MSSQL.SQL.Add('INSERT INTO tblXX ' +
' (TranID) ' +
' VALUES ' +
' (7002100 + ' + IntToStr(i) )');
try
dmCore.MSSQL.Execute;
except
dmCore.MSConnection.Disconnect;
dmCore.MSConnection.Connected := False;
dmCore.MSConnection.Close;
dmCore.MSConnection.Connected := True;

dmCore.MSSQL.Execute;
end;

SQL Server 2008
SDAC vcl ver. 6.1.3.0
Provider: SQLNCLI.1

A: Principle
B: Mirror (Failover Partner)

When A goes down, we receive exceptions (Login failed for user 'sa' and Named Pipes Provider: Could not open a connection to SQL Server[2]).

However, user 'sa' is never used. This seems to indicate that the user/pass is not passed to the partner. For Named Pipes, we have it turned off at the server.

If we close the app and restart while A is still down, the app connects to B without an issue. If A is brought back up while app is connected to B we switch over to A without issue.

We've tried to disconnect, Connected=false, Close, then connected=True within the loop before each insert to emulate closing the app and restarting and the same behavior exists.

A->B fails
B->A works

Thanks!

AndreyZ

Post by AndreyZ » Tue 13 Dec 2011 15:49

This error can occur if SQL Server Authentication is used and the user name and password are blank. In this case SDAC uses the 'sa' user to connect to a server. To avoid this problem, you should set the user name and password if SQL Server Authentication is used, or use Windows Authentication instead.

rwright
Posts: 5
Joined: Wed 17 Sep 2008 19:53

Failoverpartner

Post by rwright » Tue 13 Dec 2011 16:13

AndreyZ wrote:This error can occur if SQL Server Authentication is used and the user name and password are blank. In this case SDAC uses the 'sa' user to connect to a server. To avoid this problem, you should set the user name and password if SQL Server Authentication is used, or use Windows Authentication instead.
User name and password are present in the ConnectString

AndreyZ

Post by AndreyZ » Wed 14 Dec 2011 11:49

Please try reproducing this problem using the standard ADO components. It seems that you configured the B server incorrectly. The correct way to configure database mirroring is described at http://msdn.microsoft.com/en-us/library/ms188712.aspx

Post Reply