-->
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: Fluent NHibernate -> Caching
PostPosted: Tue Oct 28, 2008 5:37 pm 
Newbie

Joined: Tue Oct 28, 2008 5:10 pm
Posts: 1
Hi,

i hope a question about fluent nhibernate is ok here:

Is there a way to use the second level cache with Fluent NHibernate? In my pilot application for NHibernate I have some kind of fixed data(changes about once a month after the initial setup) and I think (might be wrong ofc) such a cache would make sense - right?

E.g. for the fixed data:
My pilot application is a duty roster, therefore employees, locations and duties would be kinda fixed data.


Top
 Profile  
 
 Post subject: Re: Fluent NHibernate -> Caching
PostPosted: Tue Jun 29, 2010 4:14 am 
Newbie

Joined: Tue Jun 29, 2010 4:05 am
Posts: 2
Seriously, nobody has configured 2nd level cache with fluent nHibernate?

my configuration code looks like this:

Fluently.Configure()
.Database(
MsSqlConfiguration.MsSql2005
.ConnectionString(x => x.Is(Settings.Default.Database))
.Cache(c =>
c.UseQueryCache().ProviderClass(typeof(NHibernate.Caches.MemCache.MemCacheProvider).AssemblyQualifiedName)
)
)
.ExposeConfiguration(e => e.SetProperty("hibernate.cache.use_second_level_cache", "true"))
.Mappings(m =>
m.FluentMappings.AddFromAssemblyOf<SessionFactory>()
)
.BuildSessionFactory();
}


and my app.config just has this:

<configuration>
<configSections>
<section name="memcache" type="NHibernate.Caches.MemCache.MemCacheSectionHandler, NHibernate.Caches.MemCache"/>
</configSections>
<connectionStrings>
<add name="myNameSpace.DataAccess.Properties.Settings.Database"
connectionString="Server=localhost;Initial Catalog=baseDB;Integrated Security=True;" />
</connectionStrings>
<memcache>
<memcached host="127.0.0.1" port="11211" />
</memcache>
</configuration>


When trying to run an existing session factory unit test, I get:

NUnit.Framework.AssertionException: Unexpected exception: FluentNHibernate.Cfg.FluentConfigurationException

at

var session = SessionFactory.Instance.OpenSession() (btw I love the colors :)

any ideas?


Top
 Profile  
 
 Post subject: Re: Fluent NHibernate -> Caching
PostPosted: Tue Jun 29, 2010 5:41 am 
Newbie

Joined: Tue Jun 29, 2010 4:05 am
Posts: 2
ok, the issue is referenced here

my NHibernate dlls (NHibernate, NHibernate.ByteCode.Castle and NHibernate.Caches.MemCache) are version 2.1.2.4000
and FluentNHibernate version is 1.0.0.0

the answer is probably in finding a suitable version of FluentNHibernate


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.