Question
cftransaction vs SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
Hi,
Quick question folks, I'm using a <cftransaction> and in my sql statement I'm using "SET TRANSACTION ISOLATION LEVEL READ COMMITTED;".
does the <cftransaction> tag needed if I have "SET TRANSACTION ISOLATION LEVEL READ COMMITTED;" statement within my sql statement? I'm not sure if this is necessary. here's my sample code:
<cftry>
<cfset _tStart = Timeformat(Now(), 'hh:mm tt')>
<cftransaction>
<!--- this stored proc has SET TRANSACTION ISOLATION LEVEL READ COMMITTED --->
<cfstoredproc datasource="DSN_CMS" procedure="[dbo].[proc_insertevents_backup]">
<cfprocresult name="rs1" />
</cfstoredproc>
</cftransaction>
<!--- this is optional --->
<cftransaction action="commit" />
<cfset _tEnd = Timeformat(Now(), 'hh:mm tt')>
<cfset loopTime = "#TimeFormat(DateAdd('n', DateDiff('n', _tStart, _tEnd) ,'00:00'), 'HH:mm')#" />
<cfcatch>
<!--- something happened, roll it back --->
<cftransaction action="rollback" />
</cfcatch>
</cftry>
Quick question folks, I'm using a <cftransaction> and in my sql statement I'm using "SET TRANSACTION ISOLATION LEVEL READ COMMITTED;".
does the <cftransaction> tag needed if I have "SET TRANSACTION ISOLATION LEVEL READ COMMITTED;" statement within my sql statement? I'm not sure if this is necessary. here's my sample code:
<cftry>
<cfset _tStart = Timeformat(Now(), 'hh:mm tt')>
<cftransaction>
<!--- this stored proc has SET TRANSACTION ISOLATION LEVEL READ COMMITTED --->
<cfstoredproc datasource="DSN_CMS" procedure="[dbo].[proc_insertevents_backup]">
<cfprocresult name="rs1" />
</cfstoredproc>
</cftransaction>
<!--- this is optional --->
<cftransaction action="commit" />
<cfset _tEnd = Timeformat(Now(), 'hh:mm tt')>
<cfset loopTime = "#TimeFormat(DateAdd('n', DateDiff('n', _tStart, _tEnd) ,'00:00'), 'HH:mm')#" />
<cfcatch>
<!--- something happened, roll it back --->
<cftransaction action="rollback" />
</cfcatch>
</cftry>