Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Valid Use Case for CFTHREAD
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Randy Johnson  
View profile  
 More options Jul 30 2012, 2:35 pm
From: Randy Johnson <ra...@randy.cc>
Date: Mon, 30 Jul 2012 11:35:02 -0700 (PDT)
Local: Mon, Jul 30 2012 2:35 pm
Subject: Valid Use Case for CFTHREAD

Hello,

I was wondering if this is a proper use case for cfthread.  This cfthread
would be ran via the application file on each page request.

<cfthread
name="stats"
action="run"
priority="LOW"
ipaddress = "#cgi.remote_addr#"
vcgi = "#CGI#"
vsession = "#SESSION#"
vurl="#URL#"
vform = "#FORM#"
vcreatedat="#now()#"


<cfif structKeyExists(vform,"cardnumber")><Cfset
structDelete(vform,"CARDNUMBER")></cfif>
<cfif structKeyExists(vform,"CARDCODE")><Cfset
structDelete(vform,"CARDCODE")></cfif>

<cfquery name="insertRandyStats" datasource="Randystats">
insert into stats
(createdat,ipaddress,cgi_stats,session_stats,url_stats,form_stats)
values(
<cfqueryparam cfsqltype="cf_sql_timestamp" value="#vcreatedat#">,
<cfqueryparam cfsqltype="cf_sql_longvarchar" value="#ipaddress#">,
<cfqueryparam cfsqltype="cf_sql_longvarchar" value="#SerializeJSON(vcgi)#">,
<cfqueryparam cfsqltype="cf_sql_longvarchar"
value="#SerializeJSON(vsession)#">,
<cfqueryparam cfsqltype="cf_sql_longvarchar" value="#SerializeJSON(vurl)#">,
<cfqueryparam cfsqltype="cf_sql_longvarchar"
value="#SerializeJSON(vform)#">);
</cfquery>
</cfthread>

Is there any issues that might arise from doing the stats line insert like
this?

Thanks!

Randy


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Aaron J. White  
View profile  
 More options Jul 30 2012, 4:20 pm
From: "Aaron J. White" <a...@aaronjwhite.org>
Date: Mon, 30 Jul 2012 13:20:20 -0700 (PDT)
Local: Mon, Jul 30 2012 4:20 pm
Subject: Re: Valid Use Case for CFTHREAD

I've only really used the cfthread tag when I have a process that is going
to take longer than my server's request timeout. I'm sure there are more
uses for it.

For what you're trying to do you probably want to use the background
attribute of cfquery instead though. That will make openbd add your query
to a queue and run it in the background when resources are free.

Anyone agree?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matthew Woodward  
View profile  
 More options Jul 30 2012, 9:55 pm
From: Matthew Woodward <m...@mattwoodward.com>
Date: Mon, 30 Jul 2012 18:55:41 -0700
Local: Mon, Jul 30 2012 9:55 pm
Subject: Re: [OpenBD] Re: Valid Use Case for CFTHREAD

On Mon, Jul 30, 2012 at 1:20 PM, Aaron J. White <a...@aaronjwhite.org> wrote:

> For what you're trying to do you probably want to use the background
> attribute of cfquery instead though. That will make openbd add your query
> to a queue and run it in the background when resources are free.

Right, if that's all you want to do I'd go that route. Simpler and makes
the code clearer to boot.

--
Matthew Woodward
m...@mattwoodward.com
http://blog.mattwoodward.com
identi.ca / Twitter: @mpwoodward

Please do not send me proprietary file formats such as Word, PowerPoint,
etc. as attachments.
http://www.gnu.org/philosophy/no-word-attachments.html


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Randy Johnson  
View profile  
 More options Aug 1 2012, 9:04 am
From: Randy Johnson <ra...@randy.cc>
Date: Wed, 1 Aug 2012 09:04:36 -0400
Local: Wed, Aug 1 2012 9:04 am
Subject: RE: [OpenBD] Re: Valid Use Case for CFTHREAD

Wow that is cool.  For everybody’s benefit, here is the documentation:

http://wiki.openbluedragon.org/wiki/index.php/CFQUERY

*BACKGROUND Attribute*

Open BlueDragon allows use of a BACKGROUND attribute with CFQUERY. When
BACKGROUND is set to TRUE, the query is run in a background thread and
processing does not wait for the query to complete before continuing.

This differs slightly than using
CFTHREAD<http://wiki.openbluedragon.org/wiki/index.php/CFTHREAD> to
run a query. When the BACKGROUND attribute is used, a single background
thread is used for all background operations, and the background operations
are queued. When CFTHREAD is used a new thread is spawned.

Two log files are kept to track the progress of these queries.

§  querybatch.log - for successful executions

§  querybatch-errory.log - for exceptions and errors, printing out the SQL
statement of the problem

Thank you,

Randy

*From:* openbd@googlegroups.com [mailto:openbd@googlegroups.com] *On Behalf
Of *Matthew Woodward
*Sent:* Monday, July 30, 2012 9:56 PM
*To:* openbd@googlegroups.com
*Subject:* Re: [OpenBD] Re: Valid Use Case for CFTHREAD

On Mon, Jul 30, 2012 at 1:20 PM, Aaron J. White <a...@aaronjwhite.org> wrote:

For what you're trying to do you probably want to use the background
attribute of cfquery instead though. That will make openbd add your query
to a queue and run it in the background when resources are free.

Right, if that's all you want to do I'd go that route. Simpler and makes
the code clearer to boot.

--
Matthew Woodward
m...@mattwoodward.com
http://blog.mattwoodward.com
identi.ca / Twitter: @mpwoodward

Please do not send me proprietary file formats such as Word, PowerPoint,
etc. as attachments.
http://www.gnu.org/philosophy/no-word-attachments.html

--
online documentation: http://openbd.org/manual/
http://groups.google.com/group/openbd?hl=en


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alan Williamson  
View profile  
 More options Aug 1 2012, 9:16 am
From: Alan Williamson <a...@aw20.co.uk>
Date: Wed, 01 Aug 2012 09:16:59 -0400
Local: Wed, Aug 1 2012 9:16 am
Subject: Re: [OpenBD] Re: Valid Use Case for CFTHREAD

It is also in the manual ...

http://openbd.org/manual/?/database_offrequest

On 01/08/2012 09:04, Randy Johnson wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »