-->
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: SysCache relative expiration
PostPosted: Tue Jun 28, 2005 6:37 pm 
Senior
Senior

Joined: Sat May 14, 2005 8:40 am
Posts: 130
Hi all

I've recently replaced the built-in caching mechanism of Cuyahoga with the NHibernate second level cache. This works as expected except for one thing: when you set the relative expiration to 300 seconds, it appears that the caches times out after a period of 300 seconds of no activity (because of sliding expiration of the ASP.NET cache?).
Especially with high-traffic web sites you want to set the cache expiration time a little higher to reduce database load but with a high traffic there is also a higher possibility that cached items never time out because it can happen that there is always any activity within the expiration period. This way, you can't tell when changes on the web site become visible for users. I must add to this that I'm using nonstrict-read-write caching for better performance. With read-write caching, any changes appear immediately.

So, is this relative (sliding) expiration by design and should I use read-write caching, or should cached objects always time-out after a fixed period of time?

Btw, in the mapping file you have to use <jcs-cache> tags to indicate that you want to use the second level cache. Hibernate 2.1.x uses <cache> tags for this, and I really think it would be good to line up with this syntax.

Thanks, Martijn

_________________
Cuyahoga


Top
 Profile  
 
 Post subject: Re: SysCache relative expiration
PostPosted: Sun Jul 24, 2005 8:24 pm 
Contributor
Contributor

Joined: Thu May 12, 2005 8:45 am
Posts: 226
martijnb wrote:
So, is this relative (sliding) expiration by design and should I use read-write caching, or should cached objects always time-out after a fixed period of time?


It's a straight pass-through to the ASP.NET Cache class, so the behavior is dictated by Microsoft. I believe the timeout is from the last access time, so there may be something that could be done in the core of NHibernate to change the cache access patterns.

martijnb wrote:
Btw, in the mapping file you have to use <jcs-cache> tags to indicate that you want to use the second level cache. Hibernate 2.1.x uses <cache> tags for this, and I really think it would be good to line up with this syntax.


I created a ticket in Jira for it: http://jira.nhibernate.org/browse/NH-336


Top
 Profile  
 
 Post subject: Re: SysCache relative expiration
PostPosted: Sun Sep 18, 2005 3:52 am 
Newbie

Joined: Sun Sep 18, 2005 3:16 am
Posts: 1
Location: Reggio Emilia, Italy
k-dub wrote:
It's a straight pass-through to the ASP.NET Cache class, so the behavior is dictated by Microsoft. I believe the timeout is from the last access time, so there may be something that could be done in the core of NHibernate to change the cache access patterns.


I have the same problem, so I have changed SysCache with a new fixedExpiration.
The entity configured with fixedExpiration are removed from the cache after a fixed amount of time from the insertion, not from the last access.

The code is here http://mio.discoremoto.virgilio.it/rpaterlini/. Click on SysCache to download.


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.