Hello stranger,
After upgrading to 1.2 CR1 I get this exception unless I specifically configure use_second_level_cache=false.
Code:
NHibernate.HibernateException : Could not instantiate cache implementation
----> NHibernate.Cache.NoCachingEnabledException : Second-level cache is not enabled for usage [hibernate.cache.use_second_level_cache | hibernate.cache.use_query_cache]
This is the configuration I expected to work on it's own:
Code:
<nhibernate>
<add key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider" />
<add key="hibernate.connection.connection_string_name" value="LocalSqlServer" />
<add key="hibernate.connection.driver_class" value="NHibernate.Driver.SqlClientDriver"/>
<add key="hibernate.dialect" value="NHibernate.Dialect.MsSql2005Dialect"/>
</nhibernate>
What is it I don't understand? Does use_second_level_cache for some reason default to true now? If so why?
Here's the full stacktrace by the way:
Code:
N2.Tests.Definitions.DefinitionFixture.AllowedChildrenAreCorrect : NHibernate.HibernateException : Could not instantiate cache implementation
----> NHibernate.Cache.NoCachingEnabledException : Second-level cache is not enabled for usage [hibernate.cache.use_second_level_cache | hibernate.cache.use_query_cache]
at NHibernate.Cache.CacheFactory.CreateCache(String usage, String name, Boolean mutable, Settings settings, IDictionary properties)
at NHibernate.Impl.SessionFactoryImpl..ctor(Configuration cfg, IMapping mapping, Settings settings)
at NHibernate.Cfg.Configuration.BuildSessionFactory()
at N2.Persistence.NHPersistenceManager.Initialize(IFactory factory) in C:\Documents and Settings\cristian\My Documents\Visual Studio 2005\Projects\N2\N2\Persistence\NHPersistenceManager.cs:line 59
at N2.Engine.N2Factory.InvokeInitialize(IFactoryDependency dependantModule) in C:\Documents and Settings\cristian\My Documents\Visual Studio 2005\Projects\N2\N2\Engine\N2Factory.cs:line 97
at N2.Engine.N2Factory.Initialize() in C:\Documents and Settings\cristian\My Documents\Visual Studio 2005\Projects\N2\N2\Engine\N2Factory.cs:line 61
at N2.Tests.PersistenceAwareBase.InitializeFactory() in C:\Documents and Settings\cristian\My Documents\Visual Studio 2005\Projects\N2\N2.Tests\PersistenceAwareBase.cs:line 27
at N2.Tests.PersistenceAwareBase.SetUp() in C:\Documents and Settings\cristian\My Documents\Visual Studio 2005\Projects\N2\N2.Tests\PersistenceAwareBase.cs:line 20
--HibernateException
at NHibernate.Cache.NoCacheProvider.BuildCache(String regionName, IDictionary properties)
at NHibernate.Cache.CacheFactory.CreateCache(String usage, String name, Boolean mutable, Settings settings, IDictionary properties)
Thanks
/Cristian