I must be overlooking something (probably simple), but can anyone
describe to me (or point me to a blog post or other resource) that
covers how to use FNH to configure the second-level-cache properly?
In my configuration, I'm presently doing this...
MsSqlConfiguration.MsSql2005.ConnectonString(...)
.Cache(c=>c.ProviderClass<HashtableCacheProvider>());
...and in my ClassMap<T> I'm doing...
Map(...)
Cache.AsReadOnly();
...which would SEEM from the docs to be all that's needed. Using XML,
I'd also have to set...
<property name="cache.use_second_level_cache">true</property>
...in the hibernate.cfg.xml file but while I was somewhat expecting to
be able to say something like...
MsSqlConfiguration.MsSql2005.ConnectonString(...)
.Cache(c=>c.ProviderClass<HashtableCacheProvider>())
.Cache(x=x.UseSecondLevelCache(true)); //<--- expected line
here
...there's no such method exposed for the Cache. In FNH, does simply
setting the Cache's ProviderClass implicitly also ENABLE the second-
level cache or am I missing another method that's needed to actually
turn the Cache on? Didn't see anything that obvious in
intellisense...
And if nothing else is needed (e.g., my code above -- minus the extra
method I seem to want to call even though it doesn't exist -- is
actually correct), does anyone have any other ideas about why this
collection of settings actually doesn't prevent my query for my cached
objects from hitting the DB when its invoked a second time?
Feels like this would take perhaps 20 seconds in XML but is becoming
increasingly frustrating in code :(
Thoughts, anyone--?
-Steve B.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Fluent NHibernate" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/fluent-nhibernate?hl=en
-~----------~----~----~----~------~----~------~--~---