I am having a problem connecting to mirror (new Principal) server after principal failover. I am using Microsoft's JDBC driver V1.1 (I have tried version 1.2 as well).
Lets say Machine A is the principal and Machine B is the mirror. Both machines are on the same network, however, the plan is to have them distributed over a WAN and as a result, they were configured to use certificate authentication.
I replaced the ips with x and the password with *. The connection information in the hibernate config file is as follows:
<property name="connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
<property name="connection.url">jdbcqlserver://x.x.x.x:1433;failoverPartner=jdbc
qlserver://x.x.x.x:1433</property>
<property name = "loginTimeout">1</property>
<property name="connection.databaseName">APS_SQL_DEV</property>
<property name="connection.username">sa</property>
<property name="connection.password">******</property>
When Machine A and Machine B are operating in their assigned roles, the connection works and SQL statements execute as expected.
Problem:
When I force Machine A to failover and Machine B becomes the principal server, the application hangs. Looking at Machine A's log file, for the period of application hang, I noticed that user sa could not be logged in. I would expect this to be the case since Machine A is the Mirror at this point.
I decided to test the application again in the problem state. So I ran my sql statement and the application hung for about a minute. While it was hanging, I made Machine B failover and Machine A became the principal again. As soon as Machine A became the principal, the application finished executing and returned my query results.
I am not sure if this is a problem with the JDBC Driver not detecting that Machine A is throwing a login exception and not attempting to connect to the failoverPartner, or, if the SQL Instances are configured incorrectly and not returning the exception to the driver.
Please let me know if you need any log file data. Any help is greatly appreciated. Thank you inadvance!
Chris
<property name="loginTimeout">1</property>
Should read <property name="connection.loginTimeout">1</property>
Also, I have tried using
<property name="connection.integratedSecurity">true</property>
and it still did not work.
Does anyone know if the last property is required for certificate authentication? I am not sure, but I thought it was only needed for mindows authentication.
ANY help would be GREAT! Thank you!
No comments:
Post a Comment