Cftransaction issue

Posted on Jan 28, 2005

Extending on the DTS project I talked about a few posts ago, I was writing the page that would run the export. Without going into a long explanation as to the reasoning behind some of the structure, the steps were as follows:

  1. Run a stored procedure to move all purchase data into a "temporary" table of sorts
  2. Run the DTS package using the stored procedure as described here
  3. Update all the records moved with a timestamp denoting that they have been previously downloaded
In order to ensure that the items that were marked as downloaded were in fact only those that had been properly moved, I surrounded the whole thing in a cftransaction. However, when I added the cftransaction it caused SQL to lock up completely. Without the cftransaction, it worked fine. Could this have anything to do with running the DTS? If I figure it out, I will post any answers. If anyone reads this (which so far does not seem to be happening), ideas?

The code was as follows:

<cftransaction>
<!--- first, move the data to the proper table --->
<cfstoredproc procedure="usp_purchases_export" datasource="#REQUEST.dsn#">
</cfstoredproc>
<!--- now export the data to access --->
<cfstoredproc procedure="usp_executeDTS" datasource="#REQUEST.dsn#" debug="no">
   <cfprocparam cfsqltype="CF_SQL_VARCHAR" dbvarname="Server" value="127.0.0.1" null="no">
   <cfprocparam cfsqltype="CF_SQL_VARCHAR" dbvarname="PkgName" value="dts_purchases_export" null="no">
   <cfprocparam cfsqltype="CF_SQL_VARCHAR" dbvarname="ServerPWD" value="1q2w3e" null="no">
   <cfprocresult name="exportData">
</cfstoredproc>
<cfquery name="updateDownloaded" datasource="#REQUEST.dsn#">
UPDATE      purchases_main
SET      download = #now()#
WHERE      download IS NULL
</cfquery>
</cftransaction>

Comments

Roxane Rinard Hello,
Sorry I do not have an answer for you, but I, too, and playing with cftransaction and appreicate your sharing your information.
Roxane

Posted By Roxane Rinard / Posted on 11/10/2005 at 1:53 PM


Brian Rinaldi y'know..I didn't try this at the time, but maybe it will work if you are having the same issue. Perhaps you can just try calling the procedure without using cfstoredproc as:
&lt;cfquery name=&quot;stProc&quot; datasource=&quot;#dsn#&quot;&gt;
EXEC hsp_prd_browse
@id='999'
&lt;/cfquery&gt;

Posted By Brian Rinaldi / Posted on 11/10/2005 at 2:47 PM


Write your comment



(it will not be displayed)





About

My name is Brian Rinaldi and I am the Web Community Manager for Flash Platform at Adobe. I am a regular blogger, speaker and author. I also founded RIA Unleashed conference in Boston. The views expressed on this site are my own & not those of my employer.