|
From: <aye...@us...> - 2009-01-05 10:54:09
|
Revision: 3976
http://nhibernate.svn.sourceforge.net/nhibernate/?rev=3976&view=rev
Author: ayenderahien
Date: 2009-01-05 10:54:05 +0000 (Mon, 05 Jan 2009)
Log Message:
-----------
Adding more information about caching to debug log
Modified Paths:
--------------
trunk/nhibernate/src/NHibernate/Cache/StandardQueryCache.cs
trunk/nhibernate/src/NHibernate/Event/Default/DefaultInitializeCollectionEventListener.cs
trunk/nhibernate/src/NHibernate/Event/Default/DefaultLoadEventListener.cs
Modified: trunk/nhibernate/src/NHibernate/Cache/StandardQueryCache.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Cache/StandardQueryCache.cs 2009-01-05 00:13:13 UTC (rev 3975)
+++ trunk/nhibernate/src/NHibernate/Cache/StandardQueryCache.cs 2009-01-05 10:54:05 UTC (rev 3976)
@@ -70,7 +70,7 @@
if (log.IsDebugEnabled)
{
- log.Debug("caching query results in region: " + regionName);
+ log.DebugFormat("caching query results in region: '{0}'; {1}", regionName, key);
}
IList cacheable = new List<object>(result.Count + 1);
@@ -95,23 +95,23 @@
{
if (log.IsDebugEnabled)
{
- log.Debug("checking cached query results in region: " + regionName);
+ log.DebugFormat("checking cached query results in region: '{0}'; {1}", regionName, key);
}
IList cacheable = (IList)queryCache.Get(key);
if (cacheable == null)
{
- log.Debug("query results were not found in cache");
+ log.DebugFormat("query results were not found in cache: {0}", key);
return null;
}
long timestamp = (long)cacheable[0];
- log.Debug("Checking query spaces for up-to-dateness [" + spaces + "]");
+ log.DebugFormat("Checking query spaces for up-to-dateness [{0}]", spaces);
if (!isNaturalKeyLookup && !IsUpToDate(spaces, timestamp))
{
- log.Debug("cached query results were not up to date");
+ log.DebugFormat("cached query results were not up to date for: {0}", key);
return null;
}
- log.Debug("returning cached query results");
+ log.DebugFormat("returning cached query results for: {0}", key);
for (int i = 1; i < cacheable.Count; i++)
{
if (returnTypes.Length == 1)
Modified: trunk/nhibernate/src/NHibernate/Event/Default/DefaultInitializeCollectionEventListener.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Event/Default/DefaultInitializeCollectionEventListener.cs 2009-01-05 00:13:13 UTC (rev 3975)
+++ trunk/nhibernate/src/NHibernate/Event/Default/DefaultInitializeCollectionEventListener.cs 2009-01-05 10:54:05 UTC (rev 3976)
@@ -88,10 +88,12 @@
if (ce == null)
{
factory.StatisticsImplementor.SecondLevelCacheMiss(persister.Cache.RegionName);
+ log.DebugFormat("Collection cache miss: {0}", ck);
}
else
{
factory.StatisticsImplementor.SecondLevelCacheHit(persister.Cache.RegionName);
+ log.DebugFormat("Collection cache hit: {0}", ck);
}
}
Modified: trunk/nhibernate/src/NHibernate/Event/Default/DefaultLoadEventListener.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Event/Default/DefaultLoadEventListener.cs 2009-01-05 00:13:13 UTC (rev 3975)
+++ trunk/nhibernate/src/NHibernate/Event/Default/DefaultLoadEventListener.cs 2009-01-05 10:54:05 UTC (rev 3976)
@@ -415,9 +415,15 @@
if (factory.Statistics.IsStatisticsEnabled)
{
if (ce == null)
+ {
factory.StatisticsImplementor.SecondLevelCacheMiss(persister.Cache.RegionName);
+ log.DebugFormat("Entity cache miss: {0}", ck);
+ }
else
+ {
factory.StatisticsImplementor.SecondLevelCacheHit(persister.Cache.RegionName);
+ log.DebugFormat("Entity cache hit: {0}", ck);
+ }
}
if (ce != null)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|