<?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: Resolving transaction concurrency issues in a PHP+MySQL multi-user environment</title>
	<atom:link href="http://www.ardamis.com/2008/04/06/resolving-transaction-concurrency-issues-in-a-phpmysql-multi-user-environment/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ardamis.com/2008/04/06/resolving-transaction-concurrency-issues-in-a-phpmysql-multi-user-environment/</link>
	<description>Ardamis is a tiny web design studio specializing in high-quality, handmade web sites.</description>
	<pubDate>Tue, 14 Oct 2008 21:09:00 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: Tony</title>
		<link>http://www.ardamis.com/2008/04/06/resolving-transaction-concurrency-issues-in-a-phpmysql-multi-user-environment/#comment-16949</link>
		<dc:creator>Tony</dc:creator>
		<pubDate>Fri, 26 Sep 2008 11:41:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.ardamis.com/2008/04/06/resolving-transaction-concurrency-issues-in-a-phpmysql-multi-user-environment/#comment-16949</guid>
		<description>Pretty cool solution. To add to that, it works great when process collision is greater than the granularity of the MySql timestamp which is per second. ie, no 2 process will do a read/write within 1 second.

To get around this, you can store the time as a bigint which can handle milliseconds. Unless you have some serious hardware, I don't think collision granularity would go smaller than milliseconds.

Also instead of re-reading the timestamp before B saves, B should try to UPDATE row WHERE "opened timestamp" = "last modified timestamp". Otherwise the CPU could potentially decide to switch threads on you right after you've done the second read, and do the entire read-write of A in that time.</description>
		<content:encoded><![CDATA[<p>Pretty cool solution. To add to that, it works great when process collision is greater than the granularity of the MySql timestamp which is per second. ie, no 2 process will do a read/write within 1 second.</p>
<p>To get around this, you can store the time as a bigint which can handle milliseconds. Unless you have some serious hardware, I don&#8217;t think collision granularity would go smaller than milliseconds.</p>
<p>Also instead of re-reading the timestamp before B saves, B should try to UPDATE row WHERE &#8220;opened timestamp&#8221; = &#8220;last modified timestamp&#8221;. Otherwise the CPU could potentially decide to switch threads on you right after you&#8217;ve done the second read, and do the entire read-write of A in that time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ardamis</title>
		<link>http://www.ardamis.com/2008/04/06/resolving-transaction-concurrency-issues-in-a-phpmysql-multi-user-environment/#comment-15859</link>
		<dc:creator>ardamis</dc:creator>
		<pubDate>Sat, 28 Jun 2008 03:40:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.ardamis.com/2008/04/06/resolving-transaction-concurrency-issues-in-a-phpmysql-multi-user-environment/#comment-15859</guid>
		<description>That's a very interesting PowerPoint presentation, thanks for linking it.  And I'm happy to see that we both arrived at the same solution.  I hope it serves you well.</description>
		<content:encoded><![CDATA[<p>That&#8217;s a very interesting PowerPoint presentation, thanks for linking it.  And I&#8217;m happy to see that we both arrived at the same solution.  I hope it serves you well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jlaguna</title>
		<link>http://www.ardamis.com/2008/04/06/resolving-transaction-concurrency-issues-in-a-phpmysql-multi-user-environment/#comment-14773</link>
		<dc:creator>jlaguna</dc:creator>
		<pubDate>Tue, 13 May 2008 06:41:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.ardamis.com/2008/04/06/resolving-transaction-concurrency-issues-in-a-phpmysql-multi-user-environment/#comment-14773</guid>
		<description>Very good explanation, but I did found another source of information including the same idea:

http://www.cs.uta.fi/wo/slides/lecture%205.ppt</description>
		<content:encoded><![CDATA[<p>Very good explanation, but I did found another source of information including the same idea:</p>
<p><a href="http://www.cs.uta.fi/wo/slides/lecture%205.ppt" rel="nofollow">http://www.cs.uta.fi/wo/slides/lecture%205.ppt</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
