Timeout expired. 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.In the connection string we define the pool with min 4 and max 100 - by the dimensions of the website suffering from this condition, this should be sufficient. Seems to me, something opens connections, but does not release them - but I have no real good idea, on how to debug this (especially as this shows only on the production server, as usual), to find the evil doer.
Sent from my Verizon Wireless BlackBerry
--
You received this message because you are subscribed to the Google Groups "nhusers" group.We had the same problem in a live production environment (ASP.NET).
I've build a service in the past that monitors the connections that
are pooled within ASP.NET.
Because all the connection pool stuff is private or internal, you have
to do a lot of reflection stuff on private members.
Here is the code of the main method I wrote for it. Hope you can use
it:
private void UpdatePoolTable()
{
SqlConnection conn = new SqlConnection
(ApplicationSettings.ConnectionString);
conn.Open();
try
{
object factory = conn.GetConnectionFactory();
IDictionary allPoolGroups =
conn.GetPoolGroupsFromFactory();
int count = allPoolGroups.Count;
foreach (DictionaryEntry entry in allPoolGroups)
{
object poolGroup = entry.Value;
HybridDictionary poolCollection =
Typhone.Reflection.ReflectionHelper.GetFieldValue(poolGroup,
"_poolCollection") as HybridDictionary;
foreach (DictionaryEntry poolEntry in
poolCollection)
{
object foundPool = poolEntry.Value;
FieldInfo _objectListFieldInfo =
foundPool.GetType().GetField("_objectList", BindingFlags.NonPublic |
BindingFlags.Instance);
object listTDbConnectionInternal =
Typhone.Reflection.ReflectionHelper.GetFieldValue(foundPool,
"_objectList");
MethodInfo get_CountMethodInfo =
listTDbConnectionInternal.GetType().GetMethod("get_Count");
//object numConnex =
get_CountMethodInfo.Invoke(listTDbConnectionInternal, null);
object numConnex =
ReflectionHelper.InvokeMethod(listTDbConnectionInternal, "get_Count");
//MessageBox.Show(entry.Key.ToString() + ":
" + numConnex.ToString(), "Number of Physical DB Conns open");
FormFunctions.AddRowToTable(tablePoolStats,
entry.Key.ToString() + ": " + numConnex.ToString(), "");
}
}
}
finally
{
conn.Close();
conn.Dispose();
}
}
Best regards,
Harm.
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To post to this group, send email to nhu...@googlegroups.com.
To unsubscribe from this group, send email to nhusers+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.