<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>And now here&#039;s something… &#187; persistence</title>
	<atom:link href="http://christiansons.net/mike/blog/tag/persistence/feed/" rel="self" type="application/rss+xml" />
	<link>http://christiansons.net/mike/blog</link>
	<description>Java, Ant, SVN, Jetty, cygwin and other stuff…</description>
	<lastBuildDate>Fri, 02 Dec 2011 16:53:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Shutting down ehcache properly</title>
		<link>http://christiansons.net/mike/blog/2010/01/shutting-down-ehcache-properly/</link>
		<comments>http://christiansons.net/mike/blog/2010/01/shutting-down-ehcache-properly/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 17:37:29 +0000</pubDate>
		<dc:creator>Mike Christianson</dc:creator>
				<category><![CDATA[ehcache]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[persistence]]></category>
		<category><![CDATA[shutdownhook]]></category>

		<guid isPermaLink="false">http://christiansons.net/mike/blog/?p=422</guid>
		<description><![CDATA[If you&#8217;re using ehcache&#8217;s disk persistence feature, which allows the cache to survive across JVM restarts, be sure to shut down ehcache properly. To do so when using ehcache within a webapp, simply add its ShutdownListener as a listener in web.xml. &#60;listener&#62; &#60;listener-class&#62;net.sf.ehcache.constructs.web.ShutdownListener&#60;/listener-class&#62; &#60;/listener&#62; Alternatively, or when not using ehcache inside a webapp, instruct ehcache <a href='http://christiansons.net/mike/blog/2010/01/shutting-down-ehcache-properly/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re using ehcache&#8217;s disk persistence feature, which allows the cache to survive across JVM restarts, be sure to <a href="http://ehcache.org/documentation/shutdown.html">shut down ehcache properly</a>.</p>
<p>To do so when using ehcache within a webapp, simply add its <tt>ShutdownListener</tt> as a <tt>listener</tt> in <tt>web.xml</tt>.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;listener<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;listener-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>net.sf.ehcache.constructs.web.ShutdownListener<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/listener-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/listener<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Alternatively, or when not using ehcache inside a webapp, instruct ehcache to register its own <a href="http://java.sun.com/developer/TechTips/2000/tt0711.html">shutdown hook</a> by setting a system property.</p>
<pre>net.sf.ehcache.enableShutdownHook=true</pre>
<p>If you forget one of the above, your persisted cache may not be up-to-date, or worse, not persisted at all.</p>
]]></content:encoded>
			<wfw:commentRss>http://christiansons.net/mike/blog/2010/01/shutting-down-ehcache-properly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

