<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: ehcache dissected</title>
	<atom:link href="http://twasink.net/2005/10/20/ehcache-dissected/feed/" rel="self" type="application/rss+xml" />
	<link>http://twasink.net/2005/10/20/ehcache-dissected/</link>
	<description>Robert&#039;s Rambling Ruminations Regarding Reality...</description>
	<lastBuildDate>Thu, 12 Apr 2012 16:31:52 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Brian H</title>
		<link>http://twasink.net/2005/10/20/ehcache-dissected/#comment-303</link>
		<dc:creator><![CDATA[Brian H]]></dc:creator>
		<pubDate>Thu, 28 Jan 2010 23:13:17 +0000</pubDate>
		<guid isPermaLink="false">http://twasink.net/wp/?p=174#comment-303</guid>
		<description><![CDATA[Hello again.  It took a long time to get the time for it, but I&#039;ve finally implemented an ExpiredBetterThanNullSelfPopulatingCache and some other features.  

I&#039;ve started a SourceForge project: http://sourceforge.net/projects/ehcache-zen/

@VA, @Robert, @oby1, @Lee, and others, please check it out and let me know on the forums there your feedback.]]></description>
		<content:encoded><![CDATA[<p>Hello again.  It took a long time to get the time for it, but I&#8217;ve finally implemented an ExpiredBetterThanNullSelfPopulatingCache and some other features.  </p>
<p>I&#8217;ve started a SourceForge project: <a href="http://sourceforge.net/projects/ehcache-zen/" rel="nofollow">http://sourceforge.net/projects/ehcache-zen/</a></p>
<p>@VA, @Robert, @oby1, @Lee, and others, please check it out and let me know on the forums there your feedback.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Nicholson</title>
		<link>http://twasink.net/2005/10/20/ehcache-dissected/#comment-302</link>
		<dc:creator><![CDATA[Robert Nicholson]]></dc:creator>
		<pubDate>Mon, 23 Nov 2009 03:35:14 +0000</pubDate>
		<guid isPermaLink="false">http://twasink.net/wp/?p=174#comment-302</guid>
		<description><![CDATA[In your earlier post you suggest that ehcache isn&#039;t a distributed cache and back then it may not have been but is there any opinions on how well it operates as a distributed cache? In my environment we have n processes that each have their own in memory and diskstore ehcache&#039;s. It&#039;s possible we could benefit from collapsing the overlap we have across these caches but to be honest memory isn&#039;t a problem and doing so would result in more contention across these processes.]]></description>
		<content:encoded><![CDATA[<p>In your earlier post you suggest that ehcache isn&#8217;t a distributed cache and back then it may not have been but is there any opinions on how well it operates as a distributed cache? In my environment we have n processes that each have their own in memory and diskstore ehcache&#8217;s. It&#8217;s possible we could benefit from collapsing the overlap we have across these caches but to be honest memory isn&#8217;t a problem and doing so would result in more contention across these processes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: VA</title>
		<link>http://twasink.net/2005/10/20/ehcache-dissected/#comment-301</link>
		<dc:creator><![CDATA[VA]]></dc:creator>
		<pubDate>Fri, 28 Aug 2009 16:08:07 +0000</pubDate>
		<guid isPermaLink="false">http://twasink.net/wp/?p=174#comment-301</guid>
		<description><![CDATA[&lt;a href=&quot;#comment-848&quot; rel=&quot;nofollow&quot;&gt;@Brian H &lt;/a&gt; 
Hi Brian,

We have exactly the same problem - retrieve stale data from ehcache. Please post your code, it will be really helpful to all facing the same problem.

Regards,
VA]]></description>
		<content:encoded><![CDATA[<p><a href="#comment-848" rel="nofollow">@Brian H </a><br />
Hi Brian,</p>
<p>We have exactly the same problem &#8211; retrieve stale data from ehcache. Please post your code, it will be really helpful to all facing the same problem.</p>
<p>Regards,<br />
VA</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian H</title>
		<link>http://twasink.net/2005/10/20/ehcache-dissected/#comment-300</link>
		<dc:creator><![CDATA[Brian H]]></dc:creator>
		<pubDate>Fri, 21 Aug 2009 19:31:56 +0000</pubDate>
		<guid isPermaLink="false">http://twasink.net/wp/?p=174#comment-300</guid>
		<description><![CDATA[&lt;a href=&quot;#comment-800&quot; rel=&quot;nofollow&quot;&gt;@oby1 &lt;/a&gt; 

Hi oby1,

Yes, I opened a thread in the forums and there was some discussion on it:  http://sourceforge.net/forum/forum.php?thread_id=3334621&amp;forum_id=322278

I have been working on a different project since posting this but will be getting back to this in a few weeks.  At that time, I plan to subclass SelfPopulatingCache and do the following:

1)  Configure the cache to be &quot;eternal&quot; but configure the TTL and TTI according to how I actually want the expiration to work.

2)  Override &quot;public Element get(final Object key) throws LockTimeoutException&quot; to implement a custom expiry check that ignores &quot;eternal&quot; but does evaluate the TTL and TTI.  If the requested element should be expired, will call factory.createEntry(key), but if that throws an exception, will return any existing element rather than empty the cache and return null.

3)  Create a new method &quot;public Element refresh(Object key, boolean quiet) throws CacheException&quot; method to allow refreshing objects individually from an asynchronous background thread.

I will post the code once it&#039;s complete.

Regards,
Brian]]></description>
		<content:encoded><![CDATA[<p><a href="#comment-800" rel="nofollow">@oby1 </a> </p>
<p>Hi oby1,</p>
<p>Yes, I opened a thread in the forums and there was some discussion on it:  <a href="http://sourceforge.net/forum/forum.php?thread_id=3334621&#038;forum_id=322278" rel="nofollow">http://sourceforge.net/forum/forum.php?thread_id=3334621&#038;forum_id=322278</a></p>
<p>I have been working on a different project since posting this but will be getting back to this in a few weeks.  At that time, I plan to subclass SelfPopulatingCache and do the following:</p>
<p>1)  Configure the cache to be &#8220;eternal&#8221; but configure the TTL and TTI according to how I actually want the expiration to work.</p>
<p>2)  Override &#8220;public Element get(final Object key) throws LockTimeoutException&#8221; to implement a custom expiry check that ignores &#8220;eternal&#8221; but does evaluate the TTL and TTI.  If the requested element should be expired, will call factory.createEntry(key), but if that throws an exception, will return any existing element rather than empty the cache and return null.</p>
<p>3)  Create a new method &#8220;public Element refresh(Object key, boolean quiet) throws CacheException&#8221; method to allow refreshing objects individually from an asynchronous background thread.</p>
<p>I will post the code once it&#8217;s complete.</p>
<p>Regards,<br />
Brian</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert</title>
		<link>http://twasink.net/2005/10/20/ehcache-dissected/#comment-299</link>
		<dc:creator><![CDATA[Robert]]></dc:creator>
		<pubDate>Fri, 31 Jul 2009 06:14:31 +0000</pubDate>
		<guid isPermaLink="false">http://twasink.net/wp/?p=174#comment-299</guid>
		<description><![CDATA[The whole &quot;serve up stale data while I asynchronously update in the background&quot; was a task I tried to take on about 2 years ago and failed, for various reasons. The best solution I had was to use timer tasks to refresh caches in the background.]]></description>
		<content:encoded><![CDATA[<p>The whole &#8220;serve up stale data while I asynchronously update in the background&#8221; was a task I tried to take on about 2 years ago and failed, for various reasons. The best solution I had was to use timer tasks to refresh caches in the background.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: oby1</title>
		<link>http://twasink.net/2005/10/20/ehcache-dissected/#comment-298</link>
		<dc:creator><![CDATA[oby1]]></dc:creator>
		<pubDate>Fri, 31 Jul 2009 06:08:15 +0000</pubDate>
		<guid isPermaLink="false">http://twasink.net/wp/?p=174#comment-298</guid>
		<description><![CDATA[Same here - Brian H. any luck?
What solutions did you end up using for the asynchronous updates?]]></description>
		<content:encoded><![CDATA[<p>Same here &#8211; Brian H. any luck?<br />
What solutions did you end up using for the asynchronous updates?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian H</title>
		<link>http://twasink.net/2005/10/20/ehcache-dissected/#comment-297</link>
		<dc:creator><![CDATA[Brian H]]></dc:creator>
		<pubDate>Wed, 15 Jul 2009 03:28:12 +0000</pubDate>
		<guid isPermaLink="false">http://twasink.net/wp/?p=174#comment-297</guid>
		<description><![CDATA[I would ditto this comment:
&gt; Furthermore, the construct caches are not designed for extension:
&gt; we wanted to make an asynchronously updating cache (which would
&gt; return expired values while the real value was updated), but this
&gt; didn’t prove as easy as we would have liked.

I am trying to implement a cache that will continue to return stale objects if it is unable to obtain a newer version.  (I.e., something old is better than nothing.)  This seems to me like it might be a commonly required pattern, and I&#039;m curious if anyone has come up with a solution using ehcache.  

I want to use the SelfPopulatingCache to avoid having the client API dealing with the task of putting elements into the cache.  But most importantly, elements would never be evicted from the cache for being stale unless a newer replacement element can be obtained first.  Obviously, elements could still be evicted for size constraints, but in my application, the cache will be sized to avoid this.

I am currently considering using the SelfPopulatingCache code as a starting point to make my own subclass of BlockingCache that implements the desired behavior.  During get(), it would check if the retrieved element was expired and if so invoke CacheEntryFactory.createEntry(key) to obtain a new entry.  But if that call fails, it would still return the expired element.  Most importantly, though, I need to figure out how to prevent the backing cache from removing the element when I call super.get(key), so that it is available to subsequent calls as well.  Unfortunately, there seems to be no good extension point to make this change.

What I am currently leveraging is the &quot;eternal&quot; attribute in cache configuration, for an unintended purpose.  Luckily it is unnecessary if the TTL and TTI parameters are set to 0.  So I am setting my caches to eternal=true and configuring the TTL and TTI to set the timeouts I actually desire.  Then in my custom subclass of BlockingCache, the backing cache will never remove an element, and I am writing an isExpired(Element) method based on element.isExpired() and to use instead of it.  In this method, I will ignore the eternal setting but still evaluate the other expiry rules.

I&#039;m a little concerned about how to properly handle threading issues, as I see that Cache synchronizes on element before calling element.isExpired().  

It also seems unfortunate that there isn&#039;t just a configuration flag on Cache to specify whether objects are expired on get() or not.  Since the get() caller always has the ability to perform element.isExpired() and cache.remove(key) if needed, it seems like just a simple configuration flag to turn off eviction during get() would allow many more flexible usage patterns to be created.

Anyhow, I&#039;d love to get thoughts or suggestions from others who have tackled this.]]></description>
		<content:encoded><![CDATA[<p>I would ditto this comment:<br />
&gt; Furthermore, the construct caches are not designed for extension:<br />
&gt; we wanted to make an asynchronously updating cache (which would<br />
&gt; return expired values while the real value was updated), but this<br />
&gt; didn’t prove as easy as we would have liked.</p>
<p>I am trying to implement a cache that will continue to return stale objects if it is unable to obtain a newer version.  (I.e., something old is better than nothing.)  This seems to me like it might be a commonly required pattern, and I&#8217;m curious if anyone has come up with a solution using ehcache.  </p>
<p>I want to use the SelfPopulatingCache to avoid having the client API dealing with the task of putting elements into the cache.  But most importantly, elements would never be evicted from the cache for being stale unless a newer replacement element can be obtained first.  Obviously, elements could still be evicted for size constraints, but in my application, the cache will be sized to avoid this.</p>
<p>I am currently considering using the SelfPopulatingCache code as a starting point to make my own subclass of BlockingCache that implements the desired behavior.  During get(), it would check if the retrieved element was expired and if so invoke CacheEntryFactory.createEntry(key) to obtain a new entry.  But if that call fails, it would still return the expired element.  Most importantly, though, I need to figure out how to prevent the backing cache from removing the element when I call super.get(key), so that it is available to subsequent calls as well.  Unfortunately, there seems to be no good extension point to make this change.</p>
<p>What I am currently leveraging is the &#8220;eternal&#8221; attribute in cache configuration, for an unintended purpose.  Luckily it is unnecessary if the TTL and TTI parameters are set to 0.  So I am setting my caches to eternal=true and configuring the TTL and TTI to set the timeouts I actually desire.  Then in my custom subclass of BlockingCache, the backing cache will never remove an element, and I am writing an isExpired(Element) method based on element.isExpired() and to use instead of it.  In this method, I will ignore the eternal setting but still evaluate the other expiry rules.</p>
<p>I&#8217;m a little concerned about how to properly handle threading issues, as I see that Cache synchronizes on element before calling element.isExpired().  </p>
<p>It also seems unfortunate that there isn&#8217;t just a configuration flag on Cache to specify whether objects are expired on get() or not.  Since the get() caller always has the ability to perform element.isExpired() and cache.remove(key) if needed, it seems like just a simple configuration flag to turn off eviction during get() would allow many more flexible usage patterns to be created.</p>
<p>Anyhow, I&#8217;d love to get thoughts or suggestions from others who have tackled this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian H</title>
		<link>http://twasink.net/2005/10/20/ehcache-dissected/#comment-296</link>
		<dc:creator><![CDATA[Brian H]]></dc:creator>
		<pubDate>Sat, 11 Jul 2009 00:38:00 +0000</pubDate>
		<guid isPermaLink="false">http://twasink.net/wp/?p=174#comment-296</guid>
		<description><![CDATA[Great post!  I face the same desire as mentioned in the original post here:

&gt; Furthermore, the construct caches are not designed for extension:
&gt; we wanted to make an asynchronously updating cache (which would
&gt; return expired values while the real value was updated),

...and found the same limitation with extensibility.  This seems to me like it might be a commonly required pattern, and I&#039;m curious if anyone has come up with a solution using ehcache.  I also want to use the SelfPopulatingCache to avoid client API coupling to the task of putting elements.  But most importantly, elements would never be evicted from the cache for reasons of staleness unless a newer replacement element could be obtained first.  Obviously, elements could still be evicted for reasons of space constraint, but in my application, the cache will be sized to avoid this.

I am currently considering using the SelfPopulatingCache code as a starting point to make my own subclass of BlockingCache that implements the desired behavior.  During get(), it would check if the retrieved element was expired and if so invoke the CacheEntryFactory.createEntry(key) to obtain a new entry.  But if that call fails, it would still return the expired element.  Most importantly, thought, I need to figure out how to prevent the backing cache from removing the element when I call super.get(key), so that it is available to subsequent calls as well.  Unfortunately, there seems to be no good extension point to make this change.

What I am currently leveraging is the &quot;eternal&quot; attribute in cache configuration, for an unintended purpose.  Luckily it is unnecessary if the TTL and TTI parameters set to 0.  So I am setting my caches to eternal=true and configuring the TTL and TTI as I actually desire.  Then in my custom subclass of BlockingCache, the backing cache will never remove an element, and I am writing a isExpired(Element) method based on and to use instead of element.isExpired().  In this method, I will ignore the eternal setting but still evaluate the other expiry rules.

I&#039;m a little concerned about threading issues, as I see that Cache synchronizes on element before calling element.isExpired().  It also seems unfortunate that there isn&#039;t just a configuration flag on Cache to specify whether objects are expired on get() or not.  Since the get() caller always has the ability to perform element.isExpired() and cache.remove(key) if needed, it seems like just a simple configuration flag like this would allow much more flexible usage patterns to be created.

Anyhow, I&#039;d love to get thoughts or suggestions from others.]]></description>
		<content:encoded><![CDATA[<p>Great post!  I face the same desire as mentioned in the original post here:</p>
<p>&gt; Furthermore, the construct caches are not designed for extension:<br />
&gt; we wanted to make an asynchronously updating cache (which would<br />
&gt; return expired values while the real value was updated),</p>
<p>&#8230;and found the same limitation with extensibility.  This seems to me like it might be a commonly required pattern, and I&#8217;m curious if anyone has come up with a solution using ehcache.  I also want to use the SelfPopulatingCache to avoid client API coupling to the task of putting elements.  But most importantly, elements would never be evicted from the cache for reasons of staleness unless a newer replacement element could be obtained first.  Obviously, elements could still be evicted for reasons of space constraint, but in my application, the cache will be sized to avoid this.</p>
<p>I am currently considering using the SelfPopulatingCache code as a starting point to make my own subclass of BlockingCache that implements the desired behavior.  During get(), it would check if the retrieved element was expired and if so invoke the CacheEntryFactory.createEntry(key) to obtain a new entry.  But if that call fails, it would still return the expired element.  Most importantly, thought, I need to figure out how to prevent the backing cache from removing the element when I call super.get(key), so that it is available to subsequent calls as well.  Unfortunately, there seems to be no good extension point to make this change.</p>
<p>What I am currently leveraging is the &#8220;eternal&#8221; attribute in cache configuration, for an unintended purpose.  Luckily it is unnecessary if the TTL and TTI parameters set to 0.  So I am setting my caches to eternal=true and configuring the TTL and TTI as I actually desire.  Then in my custom subclass of BlockingCache, the backing cache will never remove an element, and I am writing a isExpired(Element) method based on and to use instead of element.isExpired().  In this method, I will ignore the eternal setting but still evaluate the other expiry rules.</p>
<p>I&#8217;m a little concerned about threading issues, as I see that Cache synchronizes on element before calling element.isExpired().  It also seems unfortunate that there isn&#8217;t just a configuration flag on Cache to specify whether objects are expired on get() or not.  Since the get() caller always has the ability to perform element.isExpired() and cache.remove(key) if needed, it seems like just a simple configuration flag like this would allow much more flexible usage patterns to be created.</p>
<p>Anyhow, I&#8217;d love to get thoughts or suggestions from others.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lee</title>
		<link>http://twasink.net/2005/10/20/ehcache-dissected/#comment-295</link>
		<dc:creator><![CDATA[Lee]]></dc:creator>
		<pubDate>Wed, 04 Mar 2009 12:47:26 +0000</pubDate>
		<guid isPermaLink="false">http://twasink.net/wp/?p=174#comment-295</guid>
		<description><![CDATA[&lt;&gt; This is something similar that i am also trying to do in ehcache 1.5. I was seeing if there is an ehcache way of having a reference to the value of an expired element either in a listener or some other option. No luck so far.]]></description>
		<content:encoded><![CDATA[<p>&lt;&gt; This is something similar that i am also trying to do in ehcache 1.5. I was seeing if there is an ehcache way of having a reference to the value of an expired element either in a listener or some other option. No luck so far.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abhirama</title>
		<link>http://twasink.net/2005/10/20/ehcache-dissected/#comment-294</link>
		<dc:creator><![CDATA[Abhirama]]></dc:creator>
		<pubDate>Sat, 12 Apr 2008 05:32:13 +0000</pubDate>
		<guid isPermaLink="false">http://twasink.net/wp/?p=174#comment-294</guid>
		<description><![CDATA[I am trying to implement second level object caching(query caching disabled). I want to make sure that my caching is working. Do you have any pointers as to how do I confirm this?

I am debugging through the hibernate source and I see that hibernate tries to cache objects every time on retrieval. Also once the objects are put into the cache they are no longer replaced. All this is fine. But I do not see the objects being retrieved from the cache at any point (neither before the hydration not after that).

Any pointers?

]]></description>
		<content:encoded><![CDATA[<p>I am trying to implement second level object caching(query caching disabled). I want to make sure that my caching is working. Do you have any pointers as to how do I confirm this?</p>
<p>I am debugging through the hibernate source and I see that hibernate tries to cache objects every time on retrieval. Also once the objects are put into the cache they are no longer replaced. All this is fine. But I do not see the objects being retrieved from the cache at any point (neither before the hydration not after that).</p>
<p>Any pointers?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

