Showing posts with label driver. Show all posts
Showing posts with label driver. Show all posts

Sunday, March 25, 2012

Database Mirroring Client-Side Redirect

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">jdbcTongue Tiedqlserver://x.x.x.x:1433;failoverPartner=jdbcTongue Tiedqlserver://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!

Sunday, February 19, 2012

Database logon request

Hi,

I am using CrystalReport from MS Visual Studio .Net. The report was created by the designer. It accesses a MySQL DB by the MyODBC 2.5 driver. Everything works fine on my development machine. I call the form which implements the crystalreportview and the report is displayed. Hoever, if I create an installation and run it on the deployment machine, a dialog is displayed requesting for server name, database, user name and password. Whatever I type in the login fails ("login fails. please retry"). I tried the MyODBC DSN and the MySQL user - without success.

Was anyone facing the same problem? I don't know how to proceed, it is really a strange issue, because the application runs on my development machine...

Thanks in advance.

gbrOkay. Please ignore my posting. I found out that different user accounts were created...