From: <fab...@us...> - 2009-04-02 16:12:06
|
Revision: 4174 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4174&view=rev Author: fabiomaulo Date: 2009-04-02 16:12:05 +0000 (Thu, 02 Apr 2009) Log Message: ----------- Relax of StandardQueryCache Modified Paths: -------------- trunk/nhibernate/src/NHibernate/Cache/StandardQueryCache.cs Modified: trunk/nhibernate/src/NHibernate/Cache/StandardQueryCache.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Cache/StandardQueryCache.cs 2009-04-02 04:26:33 UTC (rev 4173) +++ trunk/nhibernate/src/NHibernate/Cache/StandardQueryCache.cs 2009-04-02 16:12:05 UTC (rev 4174) @@ -1,7 +1,6 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Text; using Iesi.Collections.Generic; using log4net; using NHibernate.Cfg; @@ -75,8 +74,7 @@ log.DebugFormat("caching query results in region: '{0}'; {1}", regionName, key); } - IList cacheable = new List<object>(result.Count + 1); - cacheable.Add(ts); + IList cacheable = new List<object>(result.Count + 1) {ts}; for (int i = 0; i < result.Count; i++) { if (returnTypes.Length == 1) @@ -99,13 +97,13 @@ { log.DebugFormat("checking cached query results in region: '{0}'; {1}", regionName, key); } - IList cacheable = (IList)queryCache.Get(key); + var cacheable = (IList)queryCache.Get(key); if (cacheable == null) { log.DebugFormat("query results were not found in cache: {0}", key); return null; } - long timestamp = (long)cacheable[0]; + var timestamp = (long)cacheable[0]; if (log.IsDebugEnabled) { log.DebugFormat("Checking query spaces for up-to-dateness [{0}]", StringHelper.CollectionToString((ICollection)spaces)); @@ -148,8 +146,7 @@ { //TODO: not really completely correct, since // the UnresolvableObjectException could occur while resolving - // associations, leaving the PC in an - // inconsistent state + // associations, leaving the PC in an inconsistent state log.Debug("could not reassemble cached result set"); queryCache.Remove(key); return null; @@ -175,7 +172,7 @@ #endregion - protected bool IsUpToDate(ISet<string> spaces, long timestamp) + protected virtual bool IsUpToDate(ISet<string> spaces, long timestamp) { return updateTimestampsCache.IsUpToDate(spaces, timestamp); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |