-->
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.  [ 4 posts ] 
Author Message
 Post subject: SysCache problem
PostPosted: Tue Nov 29, 2005 6:54 pm 
I added binaries from NH 1.0.1.0 contribution package to my project. Using SysCache I get he following error, when I'm creating session factory:

Code:
[InvalidCastException: Specified cast is not valid.]
   NHibernate.Cfg.SettingsFactory.BuildSettings(IDictionary properties) +1538

[HibernateException: could not instantiate CacheProvider: NHibernate.Caches.SysCache.SysCacheSectionHandler,NHibernate.Caches.SysCache]
   NHibernate.Cfg.SettingsFactory.BuildSettings(IDictionary properties) +1620
   NHibernate.Cfg.Configuration.BuildSessionFactory() +29
   DTGlobal.Application_Start(Object sender, EventArgs e) in D:\inetpub\wwwroot\prj\DTGlobal.cs:34


What can be wrong here?


Top
  
 
 Post subject:
PostPosted: Tue Nov 29, 2005 7:34 pm 
Contributor
Contributor

Joined: Thu May 12, 2005 8:45 am
Posts: 226
The SysCacheSectionHandler is not the ICacheProvider implementation, it handles settings in the app.config. Change your properties to use SysCacheProvider as the provider_class.


Top
 Profile  
 
 Post subject: Re: Problem
PostPosted: Wed Nov 30, 2005 4:51 am 
Code:
    <configSections>
        <section name="nhibernate" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089" />
        <section name="syscache" type="NHibernate.Caches.SysCache.SysCacheSectionHandler,NHibernate.Caches.SysCache" />
        <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
    </configSections>   
    <nhibernate>
        <add key="hibernate.connection.provider" value="NHibernate.Connection.DriverConnectionProvider" />
        <add key="hibernate.dialect" value="NHibernate.Dialect.MsSql2000Dialect" />
        <add key="hibernate.connection.driver_class" value="NHibernate.Driver.SqlClientDriver" />
        <add key="hibernate.connection.connection_string" value="conn_str" />
        <add key="hibernate.cache.provider_class" value="NHibernate.Caches.SysCache.SysCacheSectionHandler,NHibernate.Caches.SysCache" />
        <add key="hibernate.cache.use_query_cache" value="true" />
        <add key="relativeExpiration" value="300" />
    </nhibernate>
    <syscache>       
        <cache region="foo" relativeExpiration="500" priority="4" />
    </syscache>


Top
  
 
 Post subject:
PostPosted: Wed Nov 30, 2005 7:58 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
Please read the documentation: http://nhibernate.sourceforge.net/nh-docs/html/NHibernate.Caches.html

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.