-->
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.  [ 6 posts ] 
Author Message
 Post subject: Second Level Cache not working
PostPosted: Tue Jul 08, 2008 10:20 am 
Newbie

Joined: Tue Jun 12, 2007 1:25 pm
Posts: 11
Location: Brazil
Hi all,

I need to improve the performance of a web application, so I resolved to enable the second level cache of NHibernate to do this.

In my first try the cache simply does not works, looking the SQL Server Profiler I saw that the NHibernate go to database everytime.

Reading the Documentation of NHibernate I solved this problem calling the method "IQuery.SetCacheable(true)".

Now the NHibernate go to database only once, but in the second call to that entity, all values are NULL!!!!!!!!!!!!!

Whats wrong??????

I tried with SysCache and Bamboo.Prevalence and the samething happens.

My NHibernate version is 1.0.3


Last edited by aplnas on Mon Jul 14, 2008 3:17 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 14, 2008 3:16 pm 
Newbie

Joined: Tue Jun 12, 2007 1:25 pm
Posts: 11
Location: Brazil
Nobody can help me???

Now, I changed the NHibernate version to 1.2.0 and without sucess!!!

I tried all caches but nothing happens!!!!!

Help me please! It's too urgent!!!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 14, 2008 4:13 pm 
Beginner
Beginner

Joined: Wed Mar 14, 2007 12:35 pm
Posts: 24
Did you try configuring cache regions?

<configSections>
<section name="syscache" type="NHibernate.Caches.SysCache.SysCacheSectionHandler, NHibernate.Caches.SysCache"/>
</configSections>
<syscache>
<cache region="blah" expiration="1000" priority="5"/>
</syscache>

Then call IQury.SetCacheRegion("blah")?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 14, 2008 4:29 pm 
Newbie

Joined: Tue Jun 12, 2007 1:25 pm
Posts: 11
Location: Brazil
a.ritchie wrote:
Did you try configuring cache regions?

<configSections>
<section name="syscache" type="NHibernate.Caches.SysCache.SysCacheSectionHandler, NHibernate.Caches.SysCache"/>
</configSections>
<syscache>
<cache region="blah" expiration="1000" priority="5"/>
</syscache>

Then call IQury.SetCacheRegion("blah")?


Not, I'll try now!!!!

P.S. The "HashtableCacheProvider" works fine.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 15, 2008 9:41 am 
Beginner
Beginner

Joined: Wed Mar 14, 2007 12:35 pm
Posts: 24
You shouldn't use that for a production based system. It may cause more problems then fixing them.

Read the documentation on it.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 15, 2008 10:29 am 
Newbie

Joined: Tue Jun 12, 2007 1:25 pm
Posts: 11
Location: Brazil
Great!!!!!!

Now the second level cache is working.

I think that is a bug.

About the HashtableCacheProvider, I know that isn't for production purposes.

Thanks!!!!


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