Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Issue #2 - removed calls to MongoServer Disconnect()

  • Loading branch information...
commit 7eb377aae61c935f7c5215a5b623ae2ab654dcd2 1 parent 2387e4a
@AdaTheDev authored
Showing with 15 additions and 43 deletions.
  1. +15 −43 MongoSessionStateStore/MongoSessionStateStore.cs
View
58 MongoSessionStateStore/MongoSessionStateStore.cs
@@ -277,14 +277,9 @@ private string Serialize(SessionStateItemCollection items)
{
WriteToEventLog(e, "SetAndReleaseItemExclusive");
throw new ProviderException(_exceptionMessage);
- }
- else
- throw e;
- }
- finally
- {
- conn.Disconnect();
- }
+ }
+ throw;
+ }
}
/// <summary>
@@ -439,13 +434,9 @@ private string Serialize(SessionStateItemCollection items)
WriteToEventLog(e, "GetSessionStoreItem");
throw new ProviderException(_exceptionMessage);
}
- else
- throw e;
- }
- finally
- {
- conn.Disconnect();
- }
+
+ throw;
+ }
return item;
}
@@ -505,13 +496,9 @@ public override void CreateUninitializedItem(System.Web.HttpContext context, str
WriteToEventLog(e, "CreateUninitializedItem");
throw new ProviderException(_exceptionMessage);
}
- else
- throw e;
- }
- finally
- {
- conn.Disconnect();
- }
+
+ throw;
+ }
}
/// <summary>
@@ -560,7 +547,6 @@ public override void ReleaseItemExclusive(System.Web.HttpContext context, string
var update = Update.Set("Locked", false);
update.Set("Expires", DateTime.Now.AddMinutes(_config.Timeout.TotalMinutes).ToUniversalTime());
-
try
{
sessionCollection.Update(query, update, _safeMode);
@@ -572,13 +558,8 @@ public override void ReleaseItemExclusive(System.Web.HttpContext context, string
WriteToEventLog(e, "ReleaseItemExclusive");
throw new ProviderException(_exceptionMessage);
}
- else
- throw e;
- }
- finally
- {
- conn.Disconnect();
- }
+ throw;
+ }
}
public override void RemoveItem(System.Web.HttpContext context, string id, object lockId, SessionStateStoreData item)
@@ -599,13 +580,9 @@ public override void RemoveItem(System.Web.HttpContext context, string id, objec
WriteToEventLog(e, "RemoveItem");
throw new ProviderException(_exceptionMessage);
}
- else
- throw e;
- }
- finally
- {
- conn.Disconnect();
- }
+
+ throw;
+ }
}
public override void ResetItemTimeout(System.Web.HttpContext context, string id)
@@ -626,12 +603,7 @@ public override void ResetItemTimeout(System.Web.HttpContext context, string id)
WriteToEventLog(e, "ResetItemTimeout");
throw new ProviderException(_exceptionMessage);
}
- else
- throw e;
- }
- finally
- {
- conn.Disconnect();
+ throw;
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.