Hello,
I've run into a problem on our test server. My application is ASP.NET with a SQL2005 server. It runs on a VPS and the SQL server is shared by the hosting company, so not under my control. LLBLGEN runtime fileversion: 2.0.0.061023, selfservice.
After the database is rebooted/restarted while my application keeps running, it seems that my application has trouble reconnecting to the database. I have one thread that polls on a fixed interval if a change is occured in the database. But this action then leads to the following exception:
Event Type: Warning
Event Source: ASP.NET 2.0.50727.0
Event Category: Web Event
Event ID: 1309
Date: 10/4/2007
Time: 11:35:14 AM
User: N/A
Computer: PVPS-1591
Description:
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 10/4/2007 11:35:14 AM
Event time (UTC): 10/4/2007 6:35:14 PM
Event ID: 2ce2ac7b6ddd4677a1dfff938b3caf4d
Event sequence: 10
Event occurrence: 3
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/670395268/Root-1-128359961953906250
Trust level: Full
Application Virtual Path: /
Application Path: C:\Inetpub\wwwroot\kwippo\
Machine name: PVPS-1591
Process information:
Process ID: 36592
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE
Exception information:
Exception type: SqlException
Exception message: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
Request information:
Request URL: [http://xx.xx.226.96/Default.aspx](http://xx.xx.226.96/Default.aspx)
Request path: /Default.aspx
User host address: xx.xx.224.133
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK SERVICE
Thread information:
Thread ID: 5
Thread account name: NT AUTHORITY\NETWORK SERVICE
Is impersonating: False
Stack trace: at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Connect(Boolean& useFailoverPartner, Boolean& failoverDemandDone, String host, String failoverPartner, String protocol, SqlInternalConnectionTds connHandler, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject, Boolean aliasLookup)
at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.ExecuteMultiRowRetrievalQuery(IRetrievalQuery queryToExecute, ITransaction containingTransaction, IEntityCollection collectionToFill, Boolean allowDuplicates, IEntityFields fieldsUsedForQuery)
at SD.LLBLGen.Pro.ORMSupportClasses.DaoBase.PerformGetMultiAction(ITransaction containingTransaction, IEntityCollection collectionToFill, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IPredicate selectFilter, IRelationCollection relations, Int32 pageNumber, Int32 pageSize)
at SD.LLBLGen.Pro.ORMSupportClasses.EntityCollectionBase1.GetMulti(IPredicate selectFilter, Int64 maxNumberOfItemsToReturn, ISortExpression sortClauses, IRelationCollection relations, Int32 pageNumber, Int32 pageSize)
at SD.LLBLGen.Pro.ORMSupportClasses.EntityCollectionBase
1.GetMulti(IPredicate selectFilter)
at TopLib.AppMod.Kernel.BL.DequeueManager.ReadQueueDefinitionsFromDB() in C:\VSDEV\TopWebPlatform\TopLib\AppMod\Kernel\BL\EmailOutQueue\DequeueManager.cs:line 29
at TopLib.AppMod.Kernel.BL.DequeueManager..ctor() in C:\VSDEV\TopWebPlatform\TopLib\AppMod\Kernel\BL\EmailOutQueue\DequeueManager.cs:line 22
at TopLib.AppMod.Kernel.BL.TopApp.StartTopApp() in C:\VSDEV\TopWebPlatform\TopLib\AppMod\Kernel\BL\TopApp\TopApp.cs:line 43
at TopLib.AppMod.Kernel.BL.TopApp..cctor() in C:\VSDEV\TopWebPlatform\TopLib\AppMod\Kernel\BL\TopApp\TopApp.cs:line 37
Additional info: the filter I use in the getMulti call on line 29 of the DequeueManager.cs is null.
My current solution is:
- stop the webserver application, stop de application pool, start the application pool and then start the webserver application. After that everything works fine again.
My question is:
What can/should I do to handle this the proper way?
Paul