Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

In his post "HOWTO ODBC .Net framework connection" (http://scn.sap.com/docs/DOC-33628), Keven Lachanced showed us how to connect to HANA using the .NET Framework and ODBC.

Keven's post is very helpful and I would like to add to it by showing how you can add scale out failover support to the ODBC connection.

Within the SAP HANA Administration Guide under section Configuring Clients for Failover we are instructed to add a list of potential master servers, separated by a semicolon, to the connection string:

I found that this does not work when using ODBC in the .NET Framework.  It seems that the first host in the list is parsed and only that host is used when making connections.

For example,  when attempting to add multiple hosts to Keven's example:

const string _strServerName = "hanaServer1:30015;hanaServer2:30015;hanaServer3:30015";

In this example, only hanaServer1:30015 will be considered for a connection.

I found that by adding a comma, not a semicolon, between the host entries, failover support was successfully added to the .NET ODBC connection:

const string _strServerName = "hanaServer1:30015,hanaServer2:30015,hanaServer3:30015";

In this example, if the connection to hanaServer1:30015 is not successful, then an attempt is made to hanaServer2:30015.  If that connection is not successful then an attempt is made to hanaServer3:30015.  Only when a connect is not possible to any of the servers in the list that an exception is thrown.

Labels in this area