<?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"
	>
<channel>
	<title>Comments on: Mnesia? MySQL? It&#8217;s The Same Transaction!</title>
	<atom:link href="http://yarivsblog.com/articles/2006/09/25/mnesia-mysql-its-the-same-transaction/feed/" rel="self" type="application/rss+xml" />
	<link>http://yarivsblog.com/articles/2006/09/25/mnesia-mysql-its-the-same-transaction/</link>
	<description>Adventures in Open Source Erlang</description>
	<pubDate>Fri, 16 May 2008 04:15:28 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Olivier</title>
		<link>http://yarivsblog.com/articles/2006/09/25/mnesia-mysql-its-the-same-transaction/#comment-95427</link>
		<dc:creator>Olivier</dc:creator>
		<pubDate>Tue, 05 Feb 2008 16:19:05 +0000</pubDate>
		<guid isPermaLink="false">#comment-95427</guid>
		<description>Hello Yariv, in some cases another way is to call MySql stored procedure. Is it possible with a simple mysql:fetch() ?</description>
		<content:encoded><![CDATA[<p>Hello Yariv, in some cases another way is to call MySql stored procedure. Is it possible with a simple mysql:fetch() ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard</title>
		<link>http://yarivsblog.com/articles/2006/09/25/mnesia-mysql-its-the-same-transaction/#comment-45636</link>
		<dc:creator>Richard</dc:creator>
		<pubDate>Thu, 20 Sep 2007 12:40:38 +0000</pubDate>
		<guid isPermaLink="false">#comment-45636</guid>
		<description>interesting... anyone have drivers for SQLITE3? How would you define the effort required? Guess I'm going to look at the code now.</description>
		<content:encoded><![CDATA[<p>interesting&#8230; anyone have drivers for SQLITE3? How would you define the effort required? Guess I&#8217;m going to look at the code now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mikkom</title>
		<link>http://yarivsblog.com/articles/2006/09/25/mnesia-mysql-its-the-same-transaction/#comment-376</link>
		<dc:creator>mikkom</dc:creator>
		<pubDate>Wed, 27 Sep 2006 10:10:14 +0000</pubDate>
		<guid isPermaLink="false">#comment-376</guid>
		<description>I got many good examples to my head during the day of coding, just wanted to say that your way is the correct one. I'll add some kind of similar way to my framework too..

cheers,
Mikko</description>
		<content:encoded><![CDATA[<p>I got many good examples to my head during the day of coding, just wanted to say that your way is the correct one. I&#8217;ll add some kind of similar way to my framework too..</p>
<p>cheers,<br />
Mikko</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mikkom</title>
		<link>http://yarivsblog.com/articles/2006/09/25/mnesia-mysql-its-the-same-transaction/#comment-374</link>
		<dc:creator>mikkom</dc:creator>
		<pubDate>Tue, 26 Sep 2006 11:16:27 +0000</pubDate>
		<guid isPermaLink="false">#comment-374</guid>
		<description>I'm not convinved either, just could not get any good examples into my head.
&lt;br /&gt;&lt;br /&gt;
The last_insert_id() example is basically the primary reason why I added possibility to use multiple queries the first place.</description>
		<content:encoded><![CDATA[<p>I&#8217;m not convinved either, just could not get any good examples into my head.</p>
<p>The last_insert_id() example is basically the primary reason why I added possibility to use multiple queries the first place.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yariv</title>
		<link>http://yarivsblog.com/articles/2006/09/25/mnesia-mysql-its-the-same-transaction/#comment-373</link>
		<dc:creator>Yariv</dc:creator>
		<pubDate>Tue, 26 Sep 2006 10:23:23 +0000</pubDate>
		<guid isPermaLink="false">#comment-373</guid>
		<description>Clarification: in this case, the program structure isn't modified, but the values returned from the SELECT statement need to be used in the following statement. In any case, I'm not convinced that the logic *never* has to be decided inside the transaction...</description>
		<content:encoded><![CDATA[<p>Clarification: in this case, the program structure isn&#8217;t modified, but the values returned from the SELECT statement need to be used in the following statement. In any case, I&#8217;m not convinced that the logic *never* has to be decided inside the transaction&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yariv</title>
		<link>http://yarivsblog.com/articles/2006/09/25/mnesia-mysql-its-the-same-transaction/#comment-372</link>
		<dc:creator>Yariv</dc:creator>
		<pubDate>Tue, 26 Sep 2006 10:18:35 +0000</pubDate>
		<guid isPermaLink="false">#comment-372</guid>
		<description>Hi Mikkom,

Having to modify program structure inside a transaction is actually a very common requirement for ErlyDB. Consider the following snippet:

&lt;pre&gt;&#60;code&#62;person:transaction(&#60;br /&#62;&lt;br /&gt;
&#38;nbsp;&#38;nbsp;fun() -&#38;amp;gt;&#60;br /&#62;&lt;br /&gt;
&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;P = person:new(&#38;amp;quot;bob&#38;amp;quot;),&#60;br /&#62;&lt;br /&gt;
&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;P1 = person:save(P), % executes INSERT followed by&#60;br /&#62;&lt;br /&gt;
&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp; % SELECT last_insert_id()&#60;br /&#62;&lt;br /&gt;
&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;people:add_person(P1)&#60;br /&#62;&lt;br /&gt;
&#38;nbsp;&#38;nbsp;end).&#60;/code&#62;&lt;/pre&gt;

Without transparent handling of transactions by the MySQL driver, the auto-generated ErlyDB code would have to be much more complex in order to support this kind of usage.</description>
		<content:encoded><![CDATA[<p>Hi Mikkom,</p>
<p>Having to modify program structure inside a transaction is actually a very common requirement for ErlyDB. Consider the following snippet:</p>
<pre>&lt;code&gt;person:transaction(&lt;br /&gt;
&amp;nbsp;&amp;nbsp;fun() -&amp;amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;P = person:new(&amp;amp;quot;bob&amp;amp;quot;),&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;P1 = person:save(P), % executes INSERT followed by&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; % SELECT last_insert_id()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;people:add_person(P1)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;end).&lt;/code&gt;</pre>
<p>Without transparent handling of transactions by the MySQL driver, the auto-generated ErlyDB code would have to be much more complex in order to support this kind of usage.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mikkom</title>
		<link>http://yarivsblog.com/articles/2006/09/25/mnesia-mysql-its-the-same-transaction/#comment-371</link>
		<dc:creator>mikkom</dc:creator>
		<pubDate>Tue, 26 Sep 2006 09:29:17 +0000</pubDate>
		<guid isPermaLink="false">#comment-371</guid>
		<description>... And I have to add that I didn't mean that I would not need information from select (you can do this with subqueries) but that you would need to modify logic based on select statements. 
&lt;br /&gt;&lt;br /&gt;
In fact I think by doing this you are using SQL as kind of a variable alternative and that is not a good thing.
&lt;br /&gt;&lt;br /&gt;
in fact I think it's quite hard to find examples where you need to modify program structure inside SQL transaction.</description>
		<content:encoded><![CDATA[<p>&#8230; And I have to add that I didn&#8217;t mean that I would not need information from select (you can do this with subqueries) but that you would need to modify logic based on select statements. </p>
<p>In fact I think by doing this you are using SQL as kind of a variable alternative and that is not a good thing.</p>
<p>in fact I think it&#8217;s quite hard to find examples where you need to modify program structure inside SQL transaction.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mikkom</title>
		<link>http://yarivsblog.com/articles/2006/09/25/mnesia-mysql-its-the-same-transaction/#comment-370</link>
		<dc:creator>mikkom</dc:creator>
		<pubDate>Tue, 26 Sep 2006 09:23:10 +0000</pubDate>
		<guid isPermaLink="false">#comment-370</guid>
		<description>that's very true, it never occured me that I would need information from select inside transaction.

I stil would not add new api functonality but instead would add a possibility to use lists or tuples inside lists to generate needed results (something I already do with my web framework), 

something like

&lt;pre&gt;[&#34;begin transaction&#34;, &lt;br /&gt;
 &#34;insert&#46;..&#34;, &lt;br /&gt;
 {&#34;update X set Y=? where id=?&#34;, &#34;select X,Y from Z&#34;},&lt;br /&gt;
 &#34;insert something new&#34;,&lt;br /&gt;
 &#34;commit&#34;&lt;/pre&gt;

Just my 2 cents :-)
Mikko</description>
		<content:encoded><![CDATA[<p>that&#8217;s very true, it never occured me that I would need information from select inside transaction.</p>
<p>I stil would not add new api functonality but instead would add a possibility to use lists or tuples inside lists to generate needed results (something I already do with my web framework), </p>
<p>something like</p>
<pre>[&quot;begin transaction&quot;, 
 &quot;insert&#46;..&quot;, 
 {&quot;update X set Y=? where id=?&quot;, &quot;select X,Y from Z&quot;},
 &quot;insert something new&quot;,
 &quot;commit&quot;</pre>
<p>Just my 2 cents :-)<br />
Mikko</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yariv</title>
		<link>http://yarivsblog.com/articles/2006/09/25/mnesia-mysql-its-the-same-transaction/#comment-369</link>
		<dc:creator>Yariv</dc:creator>
		<pubDate>Tue, 26 Sep 2006 09:08:45 +0000</pubDate>
		<guid isPermaLink="false">#comment-369</guid>
		<description>Hi Mikko,

This is essentially how I first solved the transaction issue. I added a list of statements to the transaction prior to sending them to the dispatcher, which then executed them one by one. The problem is that the results of the SELECT statement were unavailable to the statements that have followed it. This is the case also in your code if I understand it correctly.
&lt;br /&gt;&lt;br /&gt;
Don't worry about the double post -- I'll delete the redundant ones.
&lt;br /&gt;&lt;br /&gt;
Thanks,
Yariv</description>
		<content:encoded><![CDATA[<p>Hi Mikko,</p>
<p>This is essentially how I first solved the transaction issue. I added a list of statements to the transaction prior to sending them to the dispatcher, which then executed them one by one. The problem is that the results of the SELECT statement were unavailable to the statements that have followed it. This is the case also in your code if I understand it correctly.</p>
<p>Don&#8217;t worry about the double post &#8212; I&#8217;ll delete the redundant ones.</p>
<p>Thanks,<br />
Yariv</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mikko.mattila@kirkas.com</title>
		<link>http://yarivsblog.com/articles/2006/09/25/mnesia-mysql-its-the-same-transaction/#comment-368</link>
		<dc:creator>mikko.mattila@kirkas.com</dc:creator>
		<pubDate>Tue, 26 Sep 2006 05:55:44 +0000</pubDate>
		<guid isPermaLink="false">#comment-368</guid>
		<description>Okay sorry about the reposts, I just pressed the submit button a few times because nothing happened when I pressed it.. sorry again</description>
		<content:encoded><![CDATA[<p>Okay sorry about the reposts, I just pressed the submit button a few times because nothing happened when I pressed it.. sorry again</p>
]]></content:encoded>
	</item>
</channel>
</rss>
