I'm getting a weird error from CFThread. I have it wrapped around a function that runs perfectly when outside CFThread. But, it takes about 20 seconds to complete so I shoot it off to CFThread then CFLocation the user to a new page and alert them when it's done.
It's also wrapped in CFTRY to email me should there be a problem.
I'm getting emails where the CFCATCH.Message is:
"CFThread failed to set header to response as request had already completed"
I can't find any reference to an error like this on Google. I'm assuming it's not liking the fact that I'm using CFLocation directly after invoking the Thread. So, for the hell of it, I tried using a META REFRESH to redirect the user instead. Same error result.
Any ideas?
UPDATED 7/8/13:
Code here:
<cfset admsID = replace(createUUID(),"-","","all")>
<cfthread action="run" name="runADMS#admsID#" admsID="#admsID#" formstruct="#form#">
<cftry>
<cfobject component="cfc.AutoDealerBrandMarketShare" name="adms">
<cfset rptPDF = adms.buildReport(dealer=formstruct.chosenDealer,mkt=formstruct.DMACode,make=formstruct.Make,rptID=admsID)>
<cfcatch type="any">
<cfmail to="[email protected]" from="[email protected]" subject="ADMS Error">
Error occurred running a Polk Auto Dealer Market Share report.
#cfcatch.Message#
#cfcatch.detail#
</cfmail>
</cfcatch>
</cftry>
</cfthread>
<cflocation url="http://www.usercanwaithere.com">
If you think about it, it makes sense because cfthread can be still running After the respond has been sent to the client. Therefore, setting something new in header does not make sense anymore 'cause the "ship has sailed".
-- Rupesh Kumar, Adobe ColdFusion engineer