java - SQL Server mirroring_partner_instance does not have FQDN -


there 2 sql server instances mirroring setup. servera primary , serverb mirror. below connection string

jdbc:sqlserver://servera.company.com\\ab002;portnumber=23112;databasename=somedbname;integratedsecurity=false;failoverpartner=serverb.company.com\\cd002 

when servera , running primary, application connects database , works expected. when servera failsover serverb, application unable connect serverb. below error message application logs

org.springframework.jdbc.cannotgetjdbcconnectionexception: not jdbc connection; nested exception com.microsoft.sqlserver.jdbc.sqlserverexception: tcp/ip connection host serverb, port 1433 has failed. error: "null. verify connection properties. make sure instance of sql server running on host , accepting tcp/ip connections @ port. make sure tcp connections port not blocked firewall.

it should connecting serverb.company.com based on connection string. after research, found driver ignores failover information in connection string , caches primary database on initial connection primary database_mirroring table. here how database_mirroring table looks like

databasename | mirroring_role_desc | mirroring_safety_level_desc | mirroring_state_desc | mirroring_partner_instance ------------------------------------------------------------------------------------------------------------------------- somedbname   | principal           | off                         | synchronized         | serverb\cd002 

if @ column mirroring_partner_instance, not have fqdn mirroring instance , application unable resolve name. able fix locally adding entry in hosts file serverb

adding hosts entry on production servers not going possible. has faced issue before? there other way solve issue other adding hosts entry?


Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -