Can you use a CFTHREAD inside an Ajax routine?

1 view
Skip to first unread message

hofar...@houseoffusion.com

unread,
Mar 5, 2015, 3:48:18 PM3/5/15
to ColdFusion Technical Talk

It seems to me that the CFTHREAD I attempt to start from inside an Ajax routine (triggered by a CFWINDOW) never runs and doesn't generate any error message. Can anyone advise if this is a legitimate thing to do?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360205

hofar...@houseoffusion.com

unread,
Mar 5, 2015, 3:51:05 PM3/5/15
to ColdFusion Technical Talk

Yes, this works. I do it for an application I'm working on. The ajax call hits a page with a cfthread and it runs fine.

I do have problems when that cfthread calls other cfm/cfc pages that also have cfthread in them. When that happens I get an error.

Steve
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360206

hofar...@houseoffusion.com

unread,
Mar 12, 2015, 9:49:18 AM3/12/15
to ColdFusion Technical Talk

When you say it doesn靖 generate any errors, do you mean that you靶e
looked through the exception logs? Unless you are trapping it with
try/catch or a custom error handler, that零 the only place you would
discover that an error happened in a cfthread that you are spawning and
forgetting.
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360243

hofar...@houseoffusion.com

unread,
Mar 12, 2015, 4:30:10 PM3/12/15
to ColdFusion Technical Talk

Steven,

What is it that is telling you that the thread is not running? What is it supposed to do that it is not, manipulate the file system, execute a stored procedure? Is it supposed to return a value that you are not seeing? Remember that a function that initiates a thread will continue to run without waiting for the thread to finish unless a join action is performed.

Dave

-----Original Message-----
From: Bobby [mailto:bo...@acoderslife.com]
Sent: Thursday, March 12, 2015 10:49 AM
To: cf-talk
Subject: Re: Can you use a CFTHREAD inside an Ajax routine?


When you say it doesn靖 generate any errors, do you mean that you靶e looked through the exception logs? Unless you are trapping it with try/catch or a custom error handler, that零 the only place you would discover that an error happened in a cfthread that you are spawning and forgetting.

On 3/5/15, 3:47 PM, "John Pullam" <jpu...@mcleansystems.com> wrote:

>
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360256

hofar...@houseoffusion.com

unread,
Mar 16, 2015, 2:08:25 PM3/16/15
to ColdFusion Technical Talk

The original answer that this does work was enough to get me headed in the right direction. I eventually found a bug in my code; the CFTHREAD was starting up the task correctly.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360263

hofar...@houseoffusion.com

unread,
Mar 16, 2015, 8:52:28 PM3/16/15
to ColdFusion Technical Talk

I always just comment out the cfthread to single thread it and test there's
no errors.
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360264
Reply all
Reply to author
Forward
0 new messages