<?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>Kirrus' Blog &#187; notes</title>
	<atom:link href="http://kirrus.co.uk/tag/notes/feed/" rel="self" type="application/rss+xml" />
	<link>http://kirrus.co.uk</link>
	<description>MindDump. Photos. And random ramblings.</description>
	<lastBuildDate>Fri, 03 Feb 2012 16:20:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Notes / MySQL Transactions</title>
		<link>http://kirrus.co.uk/2007/11/notes-mysql-transactions/</link>
		<comments>http://kirrus.co.uk/2007/11/notes-mysql-transactions/#comments</comments>
		<pubDate>Tue, 20 Nov 2007 22:05:42 +0000</pubDate>
		<dc:creator>Kirrus</dc:creator>
				<category><![CDATA[Remember This]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[notes]]></category>
		<category><![CDATA[photo]]></category>

		<guid isPermaLink="false">http://kirrus.co.uk/?p=23</guid>
		<description><![CDATA[Why should you not use your notepad as a coaster? This is why: The notes did say this, before my lovely hot black coffee destroyed them: &#8220;begin&#8221; == Start transaction &#8220;commit&#8221; == End transaction, saving all changes &#8220;rollback&#8221; == Undo all changes that you&#8217;ve made in the transaction What are they? In mySQL 5, with [...]]]></description>
			<content:encoded><![CDATA[<p>Why should you not use your notepad as a coaster? This is why:</p>
<p><a title="Notes by Kirrus, on Flickr" href="http://www.flickr.com/photos/79206134@N00/2051209624/"><img src="http://farm3.static.flickr.com/2121/2051209624_04e2fd185f_o.jpg" alt="Notes" width="400" height="161" /></a><br />
The notes did say this, before my lovely hot black coffee destroyed them:</p>
<table class="vertical listing" border="0">
<tbody>
<tr>
<td>&#8220;begin&#8221;</td>
<td>== Start transaction</td>
</tr>
<tr>
<td>&#8220;commit&#8221;</td>
<td>== End transaction, saving all changes</td>
</tr>
<tr>
<td>&#8220;rollback&#8221;</td>
<td>== Undo all changes that you&#8217;ve made in the transaction</td>
</tr>
</tbody>
</table>
<p>What are they? In mySQL 5, with a table storage type of &#8220;innodb&#8221; you can use transactions. This means, that you can make a set of changes together, like recording the removal of a credit, and the adding of an advert to a website, at one instance, even if it&#8217;s multiple mysql transactions within one connection.</p>
<p>You do that, by sending the command (literally &#8220;BEGIN;&#8221; or &#8220;begin;&#8221;) to start a transaction, run all the queries you need to run, and then run the commit if you want the all the changes to take, or rollback if you don&#8217;t. If any one of the sql queries fails after you&#8217;ve made a begin, and it shouldn&#8217;t have, you can rollback *all* the changes you&#8217;ve made to the database. Obviously, this needs one mySQL connection, but if you&#8217;re using more than one each run of the program you&#8217;re using, I&#8217;d be very surprised.</p>
]]></content:encoded>
			<wfw:commentRss>http://kirrus.co.uk/2007/11/notes-mysql-transactions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

