Modified:
branches/5.1/CHANGES
branches/5.1/Driver/Source/ProcedureCache.cs
Log:
Fixed a problem in procedure cache where it was possible to get into a race condition and
cause a memory leak (bug #34338). This was fixed by introducing some better locking.
Modified: branches/5.1/CHANGES
===================================================================
--- branches/5.1/CHANGES 2008-02-14 17:11:47 UTC (rev 1178)
+++ branches/5.1/CHANGES 2008-02-14 20:23:37 UTC (rev 1179)
@@ -1,6 +1,8 @@
Version 5.1.6
- Fixed problem where parameters lists were not showing when you tried to alter a
routine
in server explorer. (bug #34359)
+ - Fixed a problem in procedure cache where it was possible to get into a race condition
+ and cause a memory leak (bug #34338)
Version 5.1.5 -
- Fixed problem with membership provider where FindUserByEmail would fail trying to add
Modified: branches/5.1/Driver/Source/ProcedureCache.cs
===================================================================
--- branches/5.1/Driver/Source/ProcedureCache.cs 2008-02-14 17:11:47 UTC (rev 1178)
+++ branches/5.1/Driver/Source/ProcedureCache.cs 2008-02-14 20:23:37 UTC (rev 1179)
@@ -52,7 +52,11 @@
{
int hash = spName.GetHashCode();
- DataSet ds = (DataSet) procHash[hash];
+ DataSet ds = null;
+ lock (procHash.SyncRoot)
+ {
+ ds = (DataSet)procHash[hash];
+ }
if (ds == null)
{
ds = AddNew(conn, spName);
@@ -80,11 +84,11 @@
DataSet procData = GetProcData(connection, spName);
if (maxSize > 0)
{
- if (procHash.Keys.Count == maxSize)
- TrimHash();
int hash = spName.GetHashCode();
lock (procHash.SyncRoot)
{
+ if (procHash.Keys.Count >= maxSize)
+ TrimHash();
if (!procHash.ContainsKey(hash))
{
procHash[hash] = procData;
| Thread |
|---|
| • Connector/NET commit: r1179 - in branches/5.1: . Driver/Source | rburnett | 14 Feb |