Hi Sean,
I have a cfhttp call inside a cfc method as described and it is called a lot. I'm assuming that the named lock could cause performance problems so am considering the light-weight container component instead.
On this issue, does the <cfinovke> tag handle creation and destrruction of the lightweight container component object or do I need to var it make sure its created and destroyed with each call.
Cheers, Pete (aka lad4bear)
----Original Message Follows----
From: Sean Corfield <[EMAIL PROTECTED]>
Reply-To: [email protected]
To: [email protected]
Subject: Re: [CFCDev] CFC's and the var scope
Date: Sat, 4 Jun 2005 14:51:09 -0700
On 6/4/05, Phil Cruz <[EMAIL PROTECTED]> wrote:
> Regarding the use of CFHTTP, I read a comment by Christian on this blog post
> (http://www.compoundtheory.com/?action="">> that says you should use a named lock around CFHTTP, so would this be the
> correct implementation of a CFC method using CFHTTP (of a CFC in a shared
> scope)?
If you're still using CFMX 6.1, you could either use that technique or
simply move the <cfhttp> call into a lightweight component that is
created on each request - so someFunction() would do a <cfinvoke
component="myCFHTTPCFC" method="doCFHTTP"
returnvariable="httpResult"/> and the myCFHTTPCFC would be created
(and destroyed) for each request. That avoids locking - and
single-threading, if your application calls this method a lot.
If you're on CFMX 7, just create a local var variable, e.g.,
httpResult, and specify result="httpResult" in the <cfhttp> tag. Then
use httpResult.xxx instead of CFHTTP.xxx
--
Sean A Corfield -- http://corfield.org/
Team Fusebox -- http://fusebox.org/
Got Gmail? -- I have 50, yes 50, invites to give away!
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).
CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm
An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).
CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm
An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
