It's a situation where, as the data is constantly changing, the page is constantly being refreshed, and the above code, designated "cleint code" constantly gets executed which sometimes results in semaphore concurrency problems, and we're not sure why.. As I understand, it may be a situation where database connections are not closed properly. As there is no explicit connect/disconnect command in the application, I'm thinking there may be some parameter in the web config that I'm not setting, which I should be. I'm setting the connection string, provider, driver class, and dialect. Anything I'm missing? Sort of grasping at straws here.
Also there are some areas of the app where a connection is created local to a particular method, a specific database operation is performed via a stored procedure, and the connection is not explicitly closed. I don't suppose this could cause a problem? I would think the connection gets closed automatically when the local method finishes execution, though I could be wrong. On Oct 4, 2:59 pm, Jason Meckley <[email protected]> wrote: > how are you managing the session? are you trying to keep persisted > entities in memory between requests (http session)? > Usually problems with Nh arise for either improper mappings or poor > session management. > > On Oct 4, 3:42 pm, scottl2001 <[email protected]> wrote: > > > > > On Oct 4, 2:06 pm, scottl2001 <[email protected]> wrote: > > > > Hello all. > > > > I'm getting a problem with semaphore timeouts which, as I gather are a > > > result of connections not being closed properly. I'm using Castle, > > > NHibernate, and MS SQL Server v 9.00.4035.00. > > > > Anybody experience this previously? Details below. > > > > Thanks in advance! > > > > client code: > > > ------------------------------------------------------------- > > > LtExpression statusLessThanShipped = new LtExpression("Status", > > > Status.Shipped); > > > > IList<Run> runs = RunProvider.CustomQuery(new Order[] > > > {Order.Asc("RunNumber") }, new ICriterion[] > > > { statusLessThanShipped }); > > > --------------------------------------------------------- > > > > results in server error: > > > > ------------------------------------------------------------------ > > > > Server Error in '/' Application. > > > ________________________________________ > > > Adding the given count to the semaphore would cause it to exceed its > > > maximum count. > > > Description: An unhandled exception occurred during the execution of > > > the current web request. Please review the stack trace for more > > > information about the error and where it originated in the code. > > > > Exception Details: System.Threading.SemaphoreFullException: Adding the > > > given count to the semaphore would cause it to exceed its maximum > > > count. > > > > Source Error: > > > An unhandled exception was generated during the execution of the > > > current web request. Information regarding the origin and location of > > > the exception can be identified using the exception stack trace below. > > > > Stack Trace: > > > > [SemaphoreFullException: Adding the given count to the semaphore would > > > cause it to exceed its maximum count.] > > > System.Threading.Semaphore.Release(Int32 releaseCount) +5291316 > > > > System.Data.ProviderBase.DbConnectionPool.PutNewObject(DbConnectionInternal > > > obj) +57 > > > > System.Data.ProviderBase.DbConnectionPool.DeactivateObject(DbConnectionInternal > > > obj) +230 > > > > System.Data.ProviderBase.DbConnectionPool.PutObject(DbConnectionInternal > > > obj, Object owningObject) +140 > > > > System.Data.ProviderBase.DbConnectionInternal.CloseConnection(DbConnection > > > owningObject, DbConnectionFactory connectionFactory) +131 > > > > System.Data.SqlClient.SqlInternalConnection.CloseConnection(DbConnection > > > owningObject, DbConnectionFactory connectionFactory) +38 > > > System.Data.SqlClient.SqlConnection.Close() +135 > > > > NHibernate.Connection.ConnectionProvider.CloseConnection(IDbConnection > > > conn) +57 > > > > [ADOException: Could not close System.Data.SqlClient.SqlConnection > > > connection] > > > > NHibernate.Connection.ConnectionProvider.CloseConnection(IDbConnection > > > conn) +162 > > > > NHibernate.Connection.DriverConnectionProvider.CloseConnection(IDbConnection > > > conn) +13 > > > NHibernate.Impl.SessionFactoryImpl.CloseConnection(IDbConnection > > > conn) +44 > > > > [ADOException: cannot close connection] > > > NHibernate.Impl.SessionFactoryImpl.CloseConnection(IDbConnection > > > conn) +96 > > > NHibernate.Impl.ConnectionManager.CloseConnection() +25 > > > NHibernate.Impl.ConnectionManager.AggressiveRelease() +59 > > > NHibernate.Impl.ConnectionManager.AfterStatement() +116 > > > NHibernate.Impl.BatcherImpl.CloseCommand(IDbCommand cmd) +141 > > > NHibernate.Impl.BatcherImpl.CloseCommand(IDbCommand st, IDataReader > > > reader) +125 > > > NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, > > > QueryParameters queryParameters, Boolean returnProxies) +673 > > > > NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor > > > session, QueryParameters queryParameters, Boolean returnProxies) +67 > > > NHibernate.Loader.Loader.DoList(ISessionImplementor session, > > > QueryParameters queryParameters) +51 > > > NHibernate.Loader.Loader.ListIgnoreQueryCache(ISessionImplementor > > > session, QueryParameters queryParameters) +18 > > > NHibernate.Loader.Loader.List(ISessionImplementor session, > > > QueryParameters queryParameters, ISet querySpaces, IType[] > > > resultTypes) +81 > > > NHibernate.Impl.SessionImpl.Find(CriteriaImpl criteria, IList > > > results) +331 > > > NHibernate.Impl.SessionImpl.Find(CriteriaImpl criteria) +39 > > > NHibernate.Impl.CriteriaImpl.List() +15 > > > Castle.ActiveRecord.ActiveRecordBase.FindAll(Type targetType, > > > Order[] orders, ICriterion[] criteria) +125 > > > > [ActiveRecordException: Could not perform FindAll for Run] > > > Castle.ActiveRecord.ActiveRecordBase.FindAll(Type targetType, > > > Order[] orders, ICriterion[] criteria) +266 > > > Castle.ActiveRecord.ActiveRecordBase`1.FindAll(Order[] orders, > > > ICriterion[] criteria) +83 > > > RunApplications.Data.Providers.BaseProvider`1.CustomQuery(Order[] > > > order, ICriterion[] criteria) in C:\development2\In Progress > > > \RunApplications\RunApplications.Data\Providers\BaseProvider.cs:139 > > > RunApplications.Data.Providers.RunProvider.CustomQuery(Order[] > > > order, ICriterion[] criteria) in C:\development2\In Progress > > > \RunApplications\RunApplications.Data\Providers\RunProvider.cs:288 > > > BusinessCenter.Web.Home.Page_Load(Object sender, EventArgs e) in C: > > > \development2\In Progress\BSPBusinessCenter\BusinessCenter.Web > > > \BusinessCenter.Web\Home.aspx.cs:23 > > > System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, > > > Object o, Object t, EventArgs e) +14 > > > System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object > > > sender, EventArgs e) +35 > > > System.Web.UI.Control.OnLoad(EventArgs e) +99 > > > System.Web.UI.Control.LoadRecursive() +50 > > > System.Web.UI.Page.ProcessRequestMain(Boolean > > > includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) > > > +627- Hide quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "Castle Project Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en.
