-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: NoCachingEnabledException after upgrade to 1.2 CR1
PostPosted: Thu Mar 22, 2007 4:15 am 
Newbie

Joined: Thu Jan 04, 2007 3:56 pm
Posts: 11
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


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 22, 2007 4:40 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
No, the default cache provider is set to NoCacheProvider. It's assumed that if you specified <cache> somewhere, you really want that cache to be there, so you should get some indication that it's disabled.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 22, 2007 5:47 am 
Newbie

Joined: Thu Jan 04, 2007 3:56 pm
Posts: 11
sergey wrote:
No, the default cache provider is set to NoCacheProvider. It's assumed that if you specified <cache> somewhere, you really want that cache to be there, so you should get some indication that it's disabled.


Aha, good change. and thanks =)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.