Hi!
10000 individual where clauses?! That sounds like some that could be
optimized before it hits both NHibernate and the database,
Still, if you really need to clear the query plan cache I guess it can be
done using reflection.
Try this:
public static class SessionFactoryExtensions
{
public static void ClearQueryPlanCache(this ISessionFactory sessionFactory)
{
var factory = sessionFactory as SessionFactoryImpl;
if (factory == null)
{
return;
}
var queryPlanCacheType = typeof (QueryPlanCache);
var cache = queryPlanCacheType
.GetField("planCache", BindingFlags.Instance | BindingFlags.NonPublic)
.GetValue(factory.QueryPlanCache) as SoftLimitMRUCache;
if (cache != null)
{
cache.Clear();
}
}
}
Maybe you want to trigger garbage collection too.
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.