<?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: Pay no attention to that callback behind the curtain!</title>
	<atom:link href="http://blog.timbunce.org/2008/05/01/pay-no-attention-to-that-callback-behind-the-curtain/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.timbunce.org/2008/05/01/pay-no-attention-to-that-callback-behind-the-curtain/</link>
	<description>Listen. Reflect. Explore. Solve.</description>
	<lastBuildDate>Tue, 10 Jan 2012 18:35:08 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: TimBunce</title>
		<link>http://blog.timbunce.org/2008/05/01/pay-no-attention-to-that-callback-behind-the-curtain/#comment-233</link>
		<dc:creator><![CDATA[TimBunce]]></dc:creator>
		<pubDate>Thu, 12 Jun 2008 14:21:00 +0000</pubDate>
		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=38#comment-233</guid>
		<description><![CDATA[NOTE: An extra callback for connect_cached, with the recursion-protection mechanism, is needed. Otherwise a connect from within connect_cached will cause problems.

Here&#039;s the code (the formatting may not survive):

        connect_cached =&gt; sub {
            # protect against recursion when gofer itself makes a connection
            return if $in_callback; local $in_callback = 1;
            my $dbh = shift-&gt;$_(@_);
            undef $_;    # tell DBI not to call original method
            return $dbh; # tell DBI to return this instead
        },]]></description>
		<content:encoded><![CDATA[<p>NOTE: An extra callback for connect_cached, with the recursion-protection mechanism, is needed. Otherwise a connect from within connect_cached will cause problems.</p>
<p>Here&#8217;s the code (the formatting may not survive):</p>
<p>        connect_cached =&gt; sub {<br />
            # protect against recursion when gofer itself makes a connection<br />
            return if $in_callback; local $in_callback = 1;<br />
            my $dbh = shift-&gt;$_(@_);<br />
            undef $_;    # tell DBI not to call original method<br />
            return $dbh; # tell DBI to return this instead<br />
        },</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TimBunce</title>
		<link>http://blog.timbunce.org/2008/05/01/pay-no-attention-to-that-callback-behind-the-curtain/#comment-156</link>
		<dc:creator><![CDATA[TimBunce]]></dc:creator>
		<pubDate>Sat, 03 May 2008 10:52:43 +0000</pubDate>
		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=38#comment-156</guid>
		<description><![CDATA[A callback can be set for any *driver* method.]]></description>
		<content:encoded><![CDATA[<p>A callback can be set for any *driver* method.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TimBunce</title>
		<link>http://blog.timbunce.org/2008/05/01/pay-no-attention-to-that-callback-behind-the-curtain/#comment-157</link>
		<dc:creator><![CDATA[TimBunce]]></dc:creator>
		<pubDate>Sat, 03 May 2008 10:50:43 +0000</pubDate>
		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=38#comment-157</guid>
		<description><![CDATA[A callback can be set for any *driver* method.]]></description>
		<content:encoded><![CDATA[<p>A callback can be set for any *driver* method.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: matthew persico</title>
		<link>http://blog.timbunce.org/2008/05/01/pay-no-attention-to-that-callback-behind-the-curtain/#comment-155</link>
		<dc:creator><![CDATA[matthew persico]]></dc:creator>
		<pubDate>Sat, 03 May 2008 02:22:37 +0000</pubDate>
		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=38#comment-155</guid>
		<description><![CDATA[I can think of one immediately - SQL rewriting. As an example, create a callback on a DBD::Sybase handle for prepare such that if the server type is ASE, leave the sql code alone BUT if the server type is IQ, replace all db..table reference with db.table. The alternative is recoding when moving to an IQ server or building the query with in if/else statement.

Can you put callback on connect and disconnect? I&#039;m sure that could be useful for something.]]></description>
		<content:encoded><![CDATA[<p>I can think of one immediately &#8211; SQL rewriting. As an example, create a callback on a DBD::Sybase handle for prepare such that if the server type is ASE, leave the sql code alone BUT if the server type is IQ, replace all db..table reference with db.table. The alternative is recoding when moving to an IQ server or building the query with in if/else statement.</p>
<p>Can you put callback on connect and disconnect? I&#8217;m sure that could be useful for something.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

