I have a problem related to ASP.NET Membership and Forms Authentication. I have been searching the solution for this quite long (including the StackOverflow.com), but was unable to find some solution with regards to my scenario. Please help me.
I am using an ASP.NET Membership and Forms Authentication in an application, the problem is that during testing the application for around more than 30 minutes,
the following errors come:-
1) The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
2) Session does not expires, and it does not redirect to the Login page.
3) Session values are becoming null at few times.
The application is in Production as well, but the client has not reported any of the above such issues yet.
Please find below the Web.config settings:-
<sessionState timeout="30" mode="InProc">
</sessionState>
<membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="20">
<providers>
<clear/>
<add name="SqlProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="DBSQLServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" passwordFormat="Hashed" applicationName="/ApplicationPortal"/>
</providers>
</membership>
<add name="DBSQLServer" connectionString="Data Source=SERVER-NAME\SQLEXPRESS2008;Initial Catalog=DB-Name;Max Pool Size=100;Trusted_Connection=True;" providerName="System.Data.SqlClient"/>
And not to forget the section:-
<authentication mode="Forms">
<forms loginUrl="~/Login.aspx" defaultUrl="~/Login.aspx" protection="All" timeout="30">
</forms>
</authentication>
Although there were few connections which were not disposed off, but now all the connections are properly disposed off.
I found somewhere that by closing the DataReaders, this will be resolved, but since I have disposed off all the connections, so does this effect if the DataReaders
are not closed/disposed in my scenario?
I would also like to know that what possible issues are there which is causing these two errors simultaneously, and how can I fix these two issues.
There has been also inline queries used at many of the pages.