<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc = "http://purl.org/dc/elements/1.1/" xmlns="http://purl.org/rss/1.0/">
	<channel rdf:about="http://livedocs.adobe.com/">
	<title>LiveDocs Comments - coldfusion - 6 - CFML_Reference - Tags-pt315.htm</title>	
		<link>http://livedocs.adobe.com/</link>
		<description>Macromedia LiveDocs - online documentation with user feedback.</description>
		<copyright>Copyright 2009, Macromedia, Inc.</copyright>
		<dc:date>2009-11-25T02:07:48</dc:date>
		<dc:language>en-us</dc:language>
		<items>
			<rdf:Seq>
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/6/CFML_Reference/Tags-pt315.htm#15108" />
				<rdf:li rdf:resource="http://livedocs.adobe.com/coldfusion/6/CFML_Reference/Tags-pt315.htm#4420" />
			</rdf:Seq>
		</items>
	</channel>
	
	<item rdf:about="http://livedocs.adobe.com/coldfusion/6/CFML_Reference/Tags-pt315.htm#15108">
		<title>coldfusion/6/CFML_Reference/Tags-pt315.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/6/CFML_Reference/Tags-pt315.htm#15108</link>
		<description>This is not a very good example of how to emply CFTRANSACTION, it does not show how to use the various actions.. Its pretty much a shot in the dark unless you get the livedocs for CF5 (which is more detailed) but following the code there is invalid because cftry requires the last tag executed within itself be cfcatch.. so the method of catching and setting a variable in that method doesn't work.. This is how you need to do it..&lt;br /&gt;&lt;br /&gt;&lt;Cfset gotrue=1&gt;&lt;br /&gt;&lt;cftransaction&gt;&lt;br /&gt;  &lt;cftry&gt;...queries here...&lt;br /&gt;    &lt;cfcatch&gt;...catch the error...&lt;br /&gt;      &lt;cfset gotrue=0&gt;&lt;br /&gt;      &lt;cftransaction action=&quot;rollback&quot;&gt;&lt;br /&gt;      &lt;cfrethrow&gt; &lt;!---This line throws the error back to your error handler if you have one.. If you don't, you can remove this...---&gt;&lt;br /&gt;    &lt;/cfcatch&gt;&lt;br /&gt;  &lt;/cftry&gt;&lt;br /&gt;  &lt;cfif gotrue eq 1&gt;&lt;br /&gt;    ...do something...&lt;br /&gt;    &lt;cftransaction action=&quot;commit&quot;&gt;&lt;br /&gt;  &lt;/cfif&gt;&lt;br /&gt;&lt;/cftransaction&gt;&lt;br /&gt;&lt;br /&gt;Livedocs really needs to improve this page, very badly...</description>
		<dc:creator>ThisIsMe</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2004-05-20T09:06:46</dc:date>
	</item>
	<item rdf:about="http://livedocs.adobe.com/coldfusion/6/CFML_Reference/Tags-pt315.htm#4420">
		<title>coldfusion/6/CFML_Reference/Tags-pt315.htm</title>
		<link>http://livedocs.adobe.com/coldfusion/6/CFML_Reference/Tags-pt315.htm#4420</link>
		<description>CFTRANSACTION and TRANSACTIONs created in SQL Server stored procedures should only be used to encapsulate code performing UPDATEs, INSERTs and DELETEs. This means that any SELECT statements should be outside of your TRANSACTIONs to avoid locking rows unnecessarily.  If your stored procs are called from within a CFTRANSACTION, you should avoid unnecessary SELECTs or move the encapsulation into your SQL Server Stored Procedure and hence move the business logic. &lt;br /&gt;&lt;br /&gt;The consequence of failing to do this is slower code since it is waiting for row and table locks to be released under small load. It can also lead to blocking on your server.</description>
		<dc:creator>earnshavian</dc:creator>
		<dc:type>0 0</dc:type>
		<dc:date>2003-12-10T07:50:50</dc:date>
	</item>
	</rdf:RDF>

