<?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/"
		>
<channel>
	<title>Comments on: Practical Nested Transactions with Zend_Db and MySQL</title>
	<atom:link href="http://www.stevehollis.com/2010/03/practical-nested-transactions-with-zend_db-and-mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stevehollis.com/2010/03/practical-nested-transactions-with-zend_db-and-mysql/</link>
	<description>Barking on about PHP, MySQL and Zend Framework</description>
	<lastBuildDate>Tue, 18 May 2010 10:28:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Steve</title>
		<link>http://www.stevehollis.com/2010/03/practical-nested-transactions-with-zend_db-and-mysql/comment-page-1/#comment-37</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Tue, 30 Mar 2010 11:15:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevehollis.com/?p=35#comment-37</guid>
		<description>Thanks for the comment. You&#039;re right - these aren&#039;t &quot;real&quot; nested transactions. 

The idea here is to provide a wrapper around a series of otherwise atomic transactions and get round the automatic COMMIT when a new BEGIN TRANSACTION is issued. For many OO web based apps, that&#039;s all you need: an entire save operation is successful or no changes are committed.

It would be possible to implement something like your pseudo code using Zend_Db/MySQL with InnoDB tables and savepoints. But in practical terms I&#039;m not sure what it achieves. It also potentially leaves the client with no clear idea what data has been saved and what hasn&#039;t. For example, changes to a parent object might be saved but changes to its children aren&#039;t.</description>
		<content:encoded><![CDATA[<p>Thanks for the comment. You&#8217;re right &#8211; these aren&#8217;t &#8220;real&#8221; nested transactions. </p>
<p>The idea here is to provide a wrapper around a series of otherwise atomic transactions and get round the automatic COMMIT when a new BEGIN TRANSACTION is issued. For many OO web based apps, that&#8217;s all you need: an entire save operation is successful or no changes are committed.</p>
<p>It would be possible to implement something like your pseudo code using Zend_Db/MySQL with InnoDB tables and savepoints. But in practical terms I&#8217;m not sure what it achieves. It also potentially leaves the client with no clear idea what data has been saved and what hasn&#8217;t. For example, changes to a parent object might be saved but changes to its children aren&#8217;t.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hlomzik</title>
		<link>http://www.stevehollis.com/2010/03/practical-nested-transactions-with-zend_db-and-mysql/comment-page-1/#comment-36</link>
		<dc:creator>hlomzik</dc:creator>
		<pubDate>Tue, 30 Mar 2010 10:26:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevehollis.com/?p=35#comment-36</guid>
		<description>That&#039;s rollback are harmful! You must use rollback flag at least, becose for now your nested rollbacks have not any sence. But it is better to use savepoints and rollbacks to it.
Some pseudocode (without normal actions):
begin () {
  if ($level &gt; 0) {
    exec (&quot;savepoint nested_db_&quot; . $level);
  }
}
rollback () {
  if ($level &gt; 1) {
    exec (&quot;rollback to savepoint nested_db_&quot; . ($level - 1));
  }
}
commit () {
  if ($level &gt; 1) {
    exec (&quot;release savepoint nested_db_&quot; . ($level - 1));
  }
}

PS: I dont know are there savepoints on Zend_DB, sorry.</description>
		<content:encoded><![CDATA[<p>That&#8217;s rollback are harmful! You must use rollback flag at least, becose for now your nested rollbacks have not any sence. But it is better to use savepoints and rollbacks to it.<br />
Some pseudocode (without normal actions):<br />
begin () {<br />
  if ($level &gt; 0) {<br />
    exec (&#8220;savepoint nested_db_&#8221; . $level);<br />
  }<br />
}<br />
rollback () {<br />
  if ($level &gt; 1) {<br />
    exec (&#8220;rollback to savepoint nested_db_&#8221; . ($level &#8211; 1));<br />
  }<br />
}<br />
commit () {<br />
  if ($level &gt; 1) {<br />
    exec (&#8220;release savepoint nested_db_&#8221; . ($level &#8211; 1));<br />
  }<br />
}</p>
<p>PS: I dont know are there savepoints on Zend_DB, sorry.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PHP-help &#187; Steve Hollis’ Blog: Practical Nested Transactions with Zend_Db and MySQL</title>
		<link>http://www.stevehollis.com/2010/03/practical-nested-transactions-with-zend_db-and-mysql/comment-page-1/#comment-19</link>
		<dc:creator>PHP-help &#187; Steve Hollis’ Blog: Practical Nested Transactions with Zend_Db and MySQL</dc:creator>
		<pubDate>Thu, 11 Mar 2010 18:32:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevehollis.com/?p=35#comment-19</guid>
		<description>[...] Steve Hollis has written an interesting article about how to handle nested transactions with Zend_Db and MySQL. [...]</description>
		<content:encoded><![CDATA[<p>[...] Steve Hollis has written an interesting article about how to handle nested transactions with Zend_Db and MySQL. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://www.stevehollis.com/2010/03/practical-nested-transactions-with-zend_db-and-mysql/comment-page-1/#comment-12</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Wed, 10 Mar 2010 08:13:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevehollis.com/?p=35#comment-12</guid>
		<description>I see how that could work.

Presumably the two begin statements only issue one &quot;real&quot; BEGIN TRANSACTION to the DB though? Otherwise any updates made between the two calls will be committed on the second.</description>
		<content:encoded><![CDATA[<p>I see how that could work.</p>
<p>Presumably the two begin statements only issue one &#8220;real&#8221; BEGIN TRANSACTION to the DB though? Otherwise any updates made between the two calls will be committed on the second.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lxs</title>
		<link>http://www.stevehollis.com/2010/03/practical-nested-transactions-with-zend_db-and-mysql/comment-page-1/#comment-11</link>
		<dc:creator>lxs</dc:creator>
		<pubDate>Tue, 09 Mar 2010 21:38:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevehollis.com/?p=35#comment-11</guid>
		<description>I implement something really similar, but with a rollback flag to manage this king of case :
1 - begin, 2 - begin, 3 - rollback, 4 - commit =&gt; the last commit must rollback, so the rollback (3)  flag the transction to be rollbacked, and when commit append, if rollback flag is set, the transaction is rollbacked.</description>
		<content:encoded><![CDATA[<p>I implement something really similar, but with a rollback flag to manage this king of case :<br />
1 &#8211; begin, 2 &#8211; begin, 3 &#8211; rollback, 4 &#8211; commit =&gt; the last commit must rollback, so the rollback (3)  flag the transction to be rollbacked, and when commit append, if rollback flag is set, the transaction is rollbacked.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Super-Skinny your Zend Framework Action Controllers (Part One) &#124; stevehollis.com</title>
		<link>http://www.stevehollis.com/2010/03/practical-nested-transactions-with-zend_db-and-mysql/comment-page-1/#comment-9</link>
		<dc:creator>Super-Skinny your Zend Framework Action Controllers (Part One) &#124; stevehollis.com</dc:creator>
		<pubDate>Tue, 09 Mar 2010 09:50:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevehollis.com/?p=35#comment-9</guid>
		<description>[...] Weier O&#8217;Phinney, Pádraic Brady, Wenbert Del Rosario and others for retweeting/linking to my first post     Social [...]</description>
		<content:encoded><![CDATA[<p>[...] Weier O&#8217;Phinney, Pádraic Brady, Wenbert Del Rosario and others for retweeting/linking to my first post     Social [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zada Hallett</title>
		<link>http://www.stevehollis.com/2010/03/practical-nested-transactions-with-zend_db-and-mysql/comment-page-1/#comment-8</link>
		<dc:creator>Zada Hallett</dc:creator>
		<pubDate>Fri, 05 Mar 2010 16:43:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevehollis.com/?p=35#comment-8</guid>
		<description>This is a good post, I stumbled across your story while looking for music news. Thanks for sharing, I&#039;ll be sure to come back.</description>
		<content:encoded><![CDATA[<p>This is a good post, I stumbled across your story while looking for music news. Thanks for sharing, I&#8217;ll be sure to come back.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anty</title>
		<link>http://www.stevehollis.com/2010/03/practical-nested-transactions-with-zend_db-and-mysql/comment-page-1/#comment-7</link>
		<dc:creator>anty</dc:creator>
		<pubDate>Fri, 05 Mar 2010 14:49:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevehollis.com/?p=35#comment-7</guid>
		<description>Thanks for this first and useful blog post!
I could slap myself for not thinking about that myself. ;)
Developing just got easier for me. yay!</description>
		<content:encoded><![CDATA[<p>Thanks for this first and useful blog post!<br />
I could slap myself for not thinking about that myself. <img src='http://www.stevehollis.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
Developing just got easier for me. yay!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eKini Web Developer Blog &#187; Zend Framework: How to use nested transactions with Zend_Db and MySQL</title>
		<link>http://www.stevehollis.com/2010/03/practical-nested-transactions-with-zend_db-and-mysql/comment-page-1/#comment-6</link>
		<dc:creator>eKini Web Developer Blog &#187; Zend Framework: How to use nested transactions with Zend_Db and MySQL</dc:creator>
		<pubDate>Fri, 05 Mar 2010 13:51:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevehollis.com/?p=35#comment-6</guid>
		<description>[...] of course, the source can be found here: http://www.stevehollis.com/2010/03/practical-nested-transactions-with-zend_db-and-mysql/       tweetmeme_style = &#039;compact&#039;;          Subscribe to comments  Comment &#124; Trackback &#124;  Post [...]</description>
		<content:encoded><![CDATA[<p>[...] of course, the source can be found here: <a href="http://www.stevehollis.com/2010/03/practical-nested-transactions-with-zend_db-and-mysql/" rel="nofollow">http://www.stevehollis.com/2010/03/practical-nested-transactions-with-zend_db-and-mysql/</a>       tweetmeme_style = &#39;compact&#39;;          Subscribe to comments  Comment | Trackback |  Post [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zend Framework in Action &#187; Steve Hollis&#8217; Blog: Practical Nested Transactions with Zend_Db and MySQL</title>
		<link>http://www.stevehollis.com/2010/03/practical-nested-transactions-with-zend_db-and-mysql/comment-page-1/#comment-3</link>
		<dc:creator>Zend Framework in Action &#187; Steve Hollis&#8217; Blog: Practical Nested Transactions with Zend_Db and MySQL</dc:creator>
		<pubDate>Fri, 05 Mar 2010 09:02:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.stevehollis.com/?p=35#comment-3</guid>
		<description>[...] Steve Hollis has written an interesting article about how to handle nested transactions with Zend_Db and MySQL. [...]</description>
		<content:encoded><![CDATA[<p>[...] Steve Hollis has written an interesting article about how to handle nested transactions with Zend_Db and MySQL. [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
