【发布时间】:2011-10-16 03:22:49
【问题描述】:
我有一个页面,它在执行某些任务之前检查用户是否处于特定角色,并且功能没有问题,并且没有对相关代码进行明显的相关更改。该站点位于运行 IIS 7.0 的我的开发计算机 (Windows Vista) 上,数据库是位于单独服务器上的 MS SQL 2005。突然间,所有对User.IsInRole 的调用都导致
System.Threading.SemaphoreFullException:将指定的计数添加到信号量会导致它超过其最大计数。
我确信重新启动 IIS 将“解决”该问题,但我想了解导致它的原因,以便确保它不会在我的生产站点上发生。
堆栈跟踪的顶部是:
[SemaphoreFullException: 将指定的计数添加到信号量会导致它超过其最大计数。] System.Threading.Semaphore.Release(Int32 releaseCount) +6065293 System.Data.ProviderBase.DbConnectionPool.PutNewObject(DbConnectionInternal obj) +57 System.Data.ProviderBase.DbConnectionPool.DeactivateObject(DbConnectionInternal obj) +338 System.Data.ProviderBase.DbConnectionPool.PutObject(DbConnectionInternal obj, Object owningObject) +163 System.Data.ProviderBase.DbConnectionInternal.CloseConnection(DbConnection owningObject, DbConnectionFactory connectionFactory) +117 System.Data.SqlClient.SqlInternalConnection.CloseConnection(DbConnection owningObject, DbConnectionFactory connectionFactory) +37 System.Data.SqlClient.SqlConnection.Close() +158 System.Web.DataAccess.SqlConnectionHolder.Close() +25 System.Web.Security.SqlRoleProvider.GetRolesForUser(字符串用户名)+847 System.Web.Security.RolePrincipal.IsInRole(字符串角色) +182
【问题讨论】:
标签: asp.net exception membership semaphore