Chris
--
Chris Velevitch
Manager - Sydney Flash Platform Developers Group
www.flashdev.org.au
Sounds messy.
<cftransaction deadlockretrycount="5">
<!--- database commands --->
</cftransaction>
That is keep retrying the specified number of times, then throw a
deadlock error.
Chreis
<cfloop index="retry" from="1" to="5">
<cfset error = false />
<cftry>
<cftransaction>
<cfquery name="yourQuery">
select *
from Blah
</cfquery>
</cftransaction>
<cfcatch type="database">
<cfset error = true />
</cfcatch>
</cftry>
<cfif error eq false>
<cfbreak />
</cfif>
</cfloop>
Regards
Dale Fraser
Why do people do
<cfif not isDefined("Attributes.retry") >
<cfset Attributes.retry = 1 >
</cfif>
Instead of
<cfparam name="Attributes.retry" default="1 />
Is there something I don't understand?
Regards
Dale Fraser
> -----Original Message-----
> From: cfau...@googlegroups.com [mailto:cfau...@googlegroups.com] On
> Behalf Of Patrick Branley
> Sent: Monday, 12 December 2005 11:32 AM
> To: cfau...@googlegroups.com
> Subject: [cfaussie] Re: How to retry a caught database deadlock?
>
> > www.flashdev.org.au <http://www.flashdev.org.au>
> >
> >
>
>
>
>
>
q1 - select t1
if q1.recordcount = 0
insert into t1
q2 - select currval(t1_pk_seq)
insert (using currval from last insert
else
update t1
update t2 using t1.pk
end
because, I have to create lots of custom tags which are reuseable.
I tried creating a custom tag like
<cf_transaction deadlockcount=5>
....
</cf_transaction>
But I get an error with the following code
<cfif thisTag.ExecutionMode IS "start">
<cfset lvCount=0>
<cftry>
<cftransaction>
<cfelse>
</cftransaction>
<cfcatch type="database">
<cfset lvCount = lvCount+1>
<cfif lvCount le #attributes.deadlockcount#>
<cftransaction action="rollback" />
<cfexit method="loop">
<cfelse>
<cfrethrow>
</cfif>
</cfcatch>
</cftry>
</cfif>
but coldfusion is too restrictive.
Chris