I have a mirrored database which is working fine for all applications. A developer wrote an application that worked before the mirror. Now sometimes he gets a connection failure and sometimes he connects fine. I see that the connection protocol being used for his app is sometimes for named pipes, so I think it tries to connect using named pipes for some reason. Maybe due to a time-out?
I advised him to include the Network attribute in his connection string. (Network=dbmsso cn;)
He is using linq / .net. Am I correct in suggesting that, or am I missing something?
Error stack
at System.Data.Sql Client.SqlInter nalConnection.O nError(SqlExcep tion exception, Boolean breakConnection , Action`1 wrapCloseInActi on)
at System.Data.Sql Client.TdsParse r.ThrowExceptio nAndWarning(Tds ParserStateObje ct stateObj, Boolean callerHasConnec tionLock, Boolean asyncClose)
at System.Data.Sql Client.TdsParse r.TryRun(RunBeh avior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleR esultSet bulkCopyHandler , TdsParserStateO bject stateObj, Boolean& dataReady)
at System.Data.Sql Client.TdsParse r.Run(RunBehavi or runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleR esultSet bulkCopyHandler , TdsParserStateO bject stateObj)
at System.Data.Sql Client.SqlInter nalConnectionTd s.CompleteLogin (Boolean enlistOK)
at System.Data.Sql Client.SqlInter nalConnectionTd s.AttemptOneLog in(ServerInfo serverInfo, String newPassword, SecureString newSecurePasswo rd, Boolean ignoreSniOpenTi meout, TimeoutTimer timeout, Boolean withFailover)
at System.Data.Sql Client.SqlInter nalConnectionTd s.LoginWithFail over(Boolean useFailoverHost , ServerInfo primaryServerIn fo, String failoverHost, String newPassword, SecureString newSecurePasswo rd, Boolean redirectedUserI nstance, SqlConnectionSt ring connectionOptio ns, SqlCredential credential, TimeoutTimer timeout)
at System.Data.Sql Client.SqlInter nalConnectionTd s.OpenLoginEnli st(TimeoutTimer timeout, SqlConnectionSt ring connectionOptio ns, SqlCredential credential, String newPassword, SecureString newSecurePasswo rd, Boolean redirectedUserI nstance)
at System.Data.Sql Client.SqlInter nalConnectionTd s..ctor(DbConne ctionPoolIdenti ty identity, SqlConnectionSt ring connectionOptio ns, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePasswo rd, Boolean redirectedUserI nstance, SqlConnectionSt ring userConnectionO ptions, SessionData reconnectSessio nData)
at System.Data.Sql Client.SqlConne ctionFactory.Cr eateConnection( DbConnectionOpt ions options, DbConnectionPoo lKey poolKey, Object poolGroupProvid erInfo, DbConnectionPoo l pool, DbConnection owningConnectio n, DbConnectionOpt ions userOptions)
at System.Data.Pro viderBase.DbCon nectionFactory. CreatePooledCon nection(DbConne ctionPool pool, DbConnection owningObject, DbConnectionOpt ions options, DbConnectionPoo lKey poolKey, DbConnectionOpt ions userOptions)
at System.Data.Pro viderBase.DbCon nectionPool.Cre ateObject(DbCon nection owningObject, DbConnectionOpt ions userOptions, DbConnectionInt ernal oldConnection)
at System.Data.Pro viderBase.DbCon nectionPool.Use rCreateRequest( DbConnection owningObject, DbConnectionOpt ions userOptions, DbConnectionInt ernal oldConnection)
at System.Data.Pro viderBase.DbCon nectionPool.Try GetConnection(D bConnection owningObject, UInt32 waitForMultiple ObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckCon nection, DbConnectionOpt ions userOptions, DbConnectionInt ernal& connection)
at System.Data.Pro viderBase.DbCon nectionPool.Try GetConnection(D bConnection owningObject, TaskCompletionS ource`1 retry, DbConnectionOpt ions userOptions, DbConnectionInt ernal& connection)
at System.Data.Pro viderBase.DbCon nectionFactory. TryGetConnectio n(DbConnection owningConnectio n, TaskCompletionS ource`1 retry, DbConnectionOpt ions userOptions, DbConnectionInt ernal oldConnection, DbConnectionInt ernal& connection)
at System.Data.Pro viderBase.DbCon nectionInternal .TryOpenConnect ionInternal(DbC onnection outerConnection , DbConnectionFac tory connectionFacto ry, TaskCompletionS ource`1 retry, DbConnectionOpt ions userOptions)
at System.Data.Pro viderBase.DbCon nectionClosed.T ryOpenConnectio n(DbConnection outerConnection , DbConnectionFac tory connectionFacto ry, TaskCompletionS ource`1 retry, DbConnectionOpt ions userOptions)
at System.Data.Sql Client.SqlConne ction.TryOpenIn ner(TaskComplet ionSource`1 retry)
at System.Data.Sql Client.SqlConne ction.TryOpen(T askCompletionSo urce`1 retry)
at System.Data.Sql Client.SqlConne ction.Open()
at System.Data.Lin q.SqlClient.Sql ConnectionManag er.UseConnectio n(IConnectionUs er user)
at System.Data.Lin q.SqlClient.Sql Provider.get_Is SqlCe()
at System.Data.Lin q.SqlClient.Sql Provider.Initia lizeProviderMod e()
at System.Data.Lin q.SqlClient.Sql Provider.System .Data.Linq.Prov ider.IProvider. Execute(Express ion query)
at System.Data.Lin q.DataQuery`1.S ystem.Collectio ns.Generic.IEnu merable<T>.GetE numerator()
at System.Collecti ons.Generic.Lis t`1..ctor(IEnum erable`1 collection)
at System.Linq.Enu merable.ToList[TSource](IEnumerable`1 source)
I advised him to include the Network attribute in his connection string. (Network=dbmsso cn;)
He is using linq / .net. Am I correct in suggesting that, or am I missing something?
Error stack
at System.Data.Sql Client.SqlInter nalConnection.O nError(SqlExcep tion exception, Boolean breakConnection , Action`1 wrapCloseInActi on)
at System.Data.Sql Client.TdsParse r.ThrowExceptio nAndWarning(Tds ParserStateObje ct stateObj, Boolean callerHasConnec tionLock, Boolean asyncClose)
at System.Data.Sql Client.TdsParse r.TryRun(RunBeh avior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleR esultSet bulkCopyHandler , TdsParserStateO bject stateObj, Boolean& dataReady)
at System.Data.Sql Client.TdsParse r.Run(RunBehavi or runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleR esultSet bulkCopyHandler , TdsParserStateO bject stateObj)
at System.Data.Sql Client.SqlInter nalConnectionTd s.CompleteLogin (Boolean enlistOK)
at System.Data.Sql Client.SqlInter nalConnectionTd s.AttemptOneLog in(ServerInfo serverInfo, String newPassword, SecureString newSecurePasswo rd, Boolean ignoreSniOpenTi meout, TimeoutTimer timeout, Boolean withFailover)
at System.Data.Sql Client.SqlInter nalConnectionTd s.LoginWithFail over(Boolean useFailoverHost , ServerInfo primaryServerIn fo, String failoverHost, String newPassword, SecureString newSecurePasswo rd, Boolean redirectedUserI nstance, SqlConnectionSt ring connectionOptio ns, SqlCredential credential, TimeoutTimer timeout)
at System.Data.Sql Client.SqlInter nalConnectionTd s.OpenLoginEnli st(TimeoutTimer timeout, SqlConnectionSt ring connectionOptio ns, SqlCredential credential, String newPassword, SecureString newSecurePasswo rd, Boolean redirectedUserI nstance)
at System.Data.Sql Client.SqlInter nalConnectionTd s..ctor(DbConne ctionPoolIdenti ty identity, SqlConnectionSt ring connectionOptio ns, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePasswo rd, Boolean redirectedUserI nstance, SqlConnectionSt ring userConnectionO ptions, SessionData reconnectSessio nData)
at System.Data.Sql Client.SqlConne ctionFactory.Cr eateConnection( DbConnectionOpt ions options, DbConnectionPoo lKey poolKey, Object poolGroupProvid erInfo, DbConnectionPoo l pool, DbConnection owningConnectio n, DbConnectionOpt ions userOptions)
at System.Data.Pro viderBase.DbCon nectionFactory. CreatePooledCon nection(DbConne ctionPool pool, DbConnection owningObject, DbConnectionOpt ions options, DbConnectionPoo lKey poolKey, DbConnectionOpt ions userOptions)
at System.Data.Pro viderBase.DbCon nectionPool.Cre ateObject(DbCon nection owningObject, DbConnectionOpt ions userOptions, DbConnectionInt ernal oldConnection)
at System.Data.Pro viderBase.DbCon nectionPool.Use rCreateRequest( DbConnection owningObject, DbConnectionOpt ions userOptions, DbConnectionInt ernal oldConnection)
at System.Data.Pro viderBase.DbCon nectionPool.Try GetConnection(D bConnection owningObject, UInt32 waitForMultiple ObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckCon nection, DbConnectionOpt ions userOptions, DbConnectionInt ernal& connection)
at System.Data.Pro viderBase.DbCon nectionPool.Try GetConnection(D bConnection owningObject, TaskCompletionS ource`1 retry, DbConnectionOpt ions userOptions, DbConnectionInt ernal& connection)
at System.Data.Pro viderBase.DbCon nectionFactory. TryGetConnectio n(DbConnection owningConnectio n, TaskCompletionS ource`1 retry, DbConnectionOpt ions userOptions, DbConnectionInt ernal oldConnection, DbConnectionInt ernal& connection)
at System.Data.Pro viderBase.DbCon nectionInternal .TryOpenConnect ionInternal(DbC onnection outerConnection , DbConnectionFac tory connectionFacto ry, TaskCompletionS ource`1 retry, DbConnectionOpt ions userOptions)
at System.Data.Pro viderBase.DbCon nectionClosed.T ryOpenConnectio n(DbConnection outerConnection , DbConnectionFac tory connectionFacto ry, TaskCompletionS ource`1 retry, DbConnectionOpt ions userOptions)
at System.Data.Sql Client.SqlConne ction.TryOpenIn ner(TaskComplet ionSource`1 retry)
at System.Data.Sql Client.SqlConne ction.TryOpen(T askCompletionSo urce`1 retry)
at System.Data.Sql Client.SqlConne ction.Open()
at System.Data.Lin q.SqlClient.Sql ConnectionManag er.UseConnectio n(IConnectionUs er user)
at System.Data.Lin q.SqlClient.Sql Provider.get_Is SqlCe()
at System.Data.Lin q.SqlClient.Sql Provider.Initia lizeProviderMod e()
at System.Data.Lin q.SqlClient.Sql Provider.System .Data.Linq.Prov ider.IProvider. Execute(Express ion query)
at System.Data.Lin q.DataQuery`1.S ystem.Collectio ns.Generic.IEnu merable<T>.GetE numerator()
at System.Collecti ons.Generic.Lis t`1..ctor(IEnum erable`1 collection)
at System.Linq.Enu merable.ToList[TSource](IEnumerable`1 source)