Hi,
I encountered 2 problems when my application reconnects to the mirror database after the principle database is not available.
My Connection String:
Data Source=ServerA;Failover Partner=ServerB;Initial Catalog=TestFailover;Persist Security Info=True;User ID=sa;Connect Timeout=45
Firstly, the following exception will be prompted when failover occurs:
A transport-level error has ocurred when received results from the server. The specified network name is no longer available
Q1: Is it normal to have this exception? Otherwise, how can I avoid this exception?
Secondly, I tried to capture the exception and retry the operation, then failover successed but the time is very slow. A simple update operation takes about 2 mins to complete which can be finished within a second under normal situation. I tried to set the Connect Timeout to 30s, but the application pending for long long time.
Q2: How can I improve the time need for failover?
A1: I don't know if you can avoid the exception.
A2: What version of the software are you using? Sounds like there is a timeout that is taking its time, either a connection timeout or a Tcp timeout. How are you testing the redirect? Try crashing the principal server with a SHUTDOWN WITH NOWAIT command.
Thanks,
Mark
|||If you are on RTM, then upgrading to SP1 should fix your problem. In RTM a dead machine caused a stall in TCP waiting for a default TCP timeout of 30 secs which is longer than the default login timeout of 15 secs.
Thanks to Chris for the information.
Mark
No comments:
Post a Comment