<?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>occasionally useful &#187; sequel</title>
	<atom:link href="http://blog.maxaller.name/category/ruby/sequel/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.maxaller.name</link>
	<description>ruby, ubuntu, etc</description>
	<lastBuildDate>Sun, 11 Jul 2010 07:01:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Gotcha with Sequel and Association Caching</title>
		<link>http://blog.maxaller.name/2009/03/gotcha-with-sequel-and-association-caching/</link>
		<comments>http://blog.maxaller.name/2009/03/gotcha-with-sequel-and-association-caching/#comments</comments>
		<pubDate>Sun, 08 Mar 2009 19:30:06 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[ramaze]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[sequel]]></category>

		<guid isPermaLink="false">http://blog.maxaller.name/?p=73</guid>
		<description><![CDATA[One thing to remember with Sequel is that it caches associations -- for an hour, by default.  Normally this is good -- if I say my_model.my_associated_models twice in one request, I'd like that to be cached.  But at least with Ramaze, where you can access a variable that persists between requests (via session, [...]]]></description>
			<content:encoded><![CDATA[<p>One thing to remember with <a href="http://sequel.rubyforge.org/">Sequel</a> is that it caches associations -- for an hour, by default.  Normally this is good -- if I say my_model.my_associated_models twice in one request, I'd like that to be cached.  But at least with <a href="http://ramaze.net/">Ramaze</a>, where you can access a variable that persists between requests (via session, like session[:user]), you have to remember that associations on that session object get cached, too.  So what does that mean?  That means if you have a user view their posts (with session[:user].posts), and then they go make a post, and then they come back to view their posts again...the new post won't be in the list of posts!  So you have two basic options here, that I know of -- either a) manually kill the cache by putting session[:user].refresh on the action that alters the associations of session[:user], or b) put session[:user].refresh in a place that gets executed at the beginning of every request.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.maxaller.name/2009/03/gotcha-with-sequel-and-association-caching/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
