c# - How does SQL Server handle Network Failover in the middle of an insert statement -
i writing application executes sql queries on database in real time.
if setup mirroring of sql server , setup failoverpartner in connection string , if primary database goes down, secondary kick in automatically , therefore not have re-open connection or clear down?
also how handle situations insert statement running , database goes down? secodary pick or lost forever? safer transactional based insert statements?
every form of high availability (mirroring, clustering) have transaction boundary: every transaction in-flight @ moment of failover rolled back. not limitation, feature. impossible write correct applications if not true.
when failover occurs, every connection using database cut. clients have re-establish new connections new principal, read again current state database , start applying new operations, on current state. correctly written applications (ie. transactional) not have issue this. poorly coded apps can lose data.
Comments
Post a Comment