Re: Application Scoped CFC's and the Request Scope

2012-05-02 Thread Steve 'Cutter' Blades

I could see issues. In thinking about standard app flow, the app is 
instantiated, calling onApplicationStart (where most of your application 
vars would get created), the onSessionStart, and only then 
onRequestStart. In that model, reffing the request scope in your 
application vars would always cause a problem, since the request vars 
would not yet exist.

Steve 'Cutter' Blades
Adobe Community Professional
Adobe Certified Expert
Advanced Macromedia ColdFusion MX 7 Developer

http://cutterscrossing.com


Co-Author "Learning Ext JS 3.2" Packt Publishing 2010
https://www.packtpub.com/learning-ext-js-3-2-for-building-dynamic-desktop-style-user-interfaces/book

"The best way to predict the future is to help create it"


On 5/1/2012 2:33 PM, Brook Davies wrote:
> Hey Guys,
>
>
>
> While I know its not best practice, I am setting some variables in the
> request scope that are then referenced by several application scoped CFCs.
> Can  this lead to collisions? I am seeing some strange errors that only
> happen when I run multiple requests at the same time and seem to involve the
> request scoped data. Could this potentially be the issue?
>
>
>
> Brook
>
>
>
>
> 

~|
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:350950
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Application Scoped CFC's and the Request Scope

2012-05-01 Thread Brook Davies

Hey Guys,

 

While I know its not best practice, I am setting some variables in the
request scope that are then referenced by several application scoped CFCs.
Can  this lead to collisions? I am seeing some strange errors that only
happen when I run multiple requests at the same time and seem to involve the
request scoped data. Could this potentially be the issue?

 

Brook




~|
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:350929
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Named arguments, UDFs, Request scope

2008-12-10 Thread Adrian Lynch
Haven't tried it myself, but take a look at the last comment here:

http://cferror.org/error.cfm?errorID=6

Shout if it works.

Adrian

> -Original Message-
> From: Michael Casey [mailto:[EMAIL PROTECTED]
> Sent: 04 December 2008 15:54
> To: cf-talk
> Subject: Re: Named arguments, UDFs, Request scope
> 
> @Dominic
> 
> Nice idea! Same result though :-(


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:316540
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Named arguments, UDFs, Request scope

2008-12-04 Thread Dominic Watson
I'm not sure, but have you tried something like:







Quite possibly brings out the same result but worth a shot...

Dominic

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:316255
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Named arguments, UDFs, Request scope

2008-12-04 Thread Michael Casey
@Dominic

Nice idea! Same result though :-( 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:316260
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Named arguments, UDFs, Request scope

2008-12-04 Thread Michael Casey
Oops, browser was set to auto-refresh, hence the double post. Sorry 'bout 
that... 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:316257
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Named arguments, UDFs, Request scope

2008-12-04 Thread Michael Casey
There is/was a problem in CF7 regarding using named arguments to call UDFs that 
were in the request scope (also mentioned here, for reference 
http://www.coldfusionjedi.com/index.cfm/2005/10/27/CFMX-7-and-Super-Fixes).

The function produces this error, "Cannot invoke method [x] on an object of 
type coldfusion.runtime.Struct with named arguments".

Does anyone know if a fix was ever produced for it? Or must I use ordered 
arguments?

Michael 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:316253
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Named arguments, UDFs, Request scope

2008-12-04 Thread Michael Casey
There is/was a problem in CF7 regarding using named arguments to call UDFs that 
were in the request scope (also mentioned here, for reference 
http://www.coldfusionjedi.com/index.cfm/2005/10/27/CFMX-7-and-Super-Fixes).

The function produces this error, "Cannot invoke method [x] on an object of 
type coldfusion.runtime.Struct with named arguments".

Does anyone know if a fix was ever produced for it? Or must I use ordered 
arguments?

Michael 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:316251
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


cftransaction and the request scope

2004-11-04 Thread Jeff Congdon
MX 6.1 environment.  For some applications, I do some datasource setup 
in the app.cfm to separate development and production environments, 
amongst other things.  So my app.cfm has some code like this


  
 
   
  
 
   


then in a page in the application, i have some transaction processing


  
   update foo set foo = bar where bar = foo
  
  
   update bar set bar = foo where foo = bar
  


sometimes, but not always,  i will get this error:
--
Data source devDS verification failed. The root cause was that: 
java.sql.SQLException: Datasource names for all the database tags within 
CFTRANSACTION must be the same.
The error occurred on line 232.
--

I was under the impression that REQUEST is a superset of the VARIABLES 
scope, and will always be thread safe and limited to the CURRENT REQUEST 
only.  While the error would imply that I am getting
different results for the REQUEST variable within the transaction, I 
have seen no evidence to back this up.  Specifically, whenever it does 
fail, it always gives the proper datasource in the error message, NEVER 
giving the "other", "improper" datasource... in this case it would be 
"productionDS".

I can work around this problem by setting variables.thisDSN = 
REQUEST.thisDSN at the top of the transaction, then just calling 
#thisDSN# in the datasource field...but what's the point?  I thought 
REQUEST was exactly the same as the VARIABLES scope, excpet REQUEST 
could be read by all parts of the thread (including custom tags).  Why 
then would it not, within the request, always define request.thisDSN 
exactly the same way?

Any ideas?  & TIA,

-Jeff


~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:183438
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: How to use Request scope?!

2004-11-03 Thread Ian Sheridan
o.param is a string that I get out of a CFPROCEDURE it's there and
avaiable. I have focused it down to the setting the request variable.

when I dump and abort the o.param it's there.

Ian


On Wed, 3 Nov 2004 17:02:11 -0800, Sean Corfield <[EMAIL PROTECTED]> wrote:
> On Wed, 3 Nov 2004 18:29:00 -0500, Ian Sheridan <[EMAIL PROTECTED]> wrote:
> > oh yeah it works I am getting the expected value in o.param.
> 
> Where is o.param set? You didn't show that in your cut-down code...
> 
> > > > 
> > > > 
> > > >
> > > > 
> > > > #request.actionpasser#
> > > >
> > > > 
> > > > 
> > > > 
> -- 
> Sean A Corfield -- http://www.corfield.org/
> Team Fusebox -- http://www.fusebox.org/
> Got Gmail? -- I have 1 invite
> 
> "If you're not annoying somebody, you're not really alive."
> -- Margaret Atwood
> 
> 

~|
Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF 
community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=34

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:183327
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: How to use Request scope?!

2004-11-03 Thread Ewok
Either way, it had to be set or the error he would get would be PARAM not
defined in O.

-Original Message-
From: Sean Corfield [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 03, 2004 8:02 PM
To: CF-Talk
Subject: Re: How to use Request scope?!

On Wed, 3 Nov 2004 18:29:00 -0500, Ian Sheridan <[EMAIL PROTECTED]>
wrote:
> oh yeah it works I am getting the expected value in o.param.

Where is o.param set? You didn't show that in your cut-down code...

> > > 
> > > 
> > >
> > > 
> > > #request.actionpasser#
> > >
> > > 
> > > 
> > > 
-- 
Sean A Corfield -- http://www.corfield.org/
Team Fusebox -- http://www.fusebox.org/
Got Gmail? -- I have 1 invite

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood



~|
Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF 
community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=34

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:183326
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: How to use Request scope?!

2004-11-03 Thread Sean Corfield
On Wed, 3 Nov 2004 18:29:00 -0500, Ian Sheridan <[EMAIL PROTECTED]> wrote:
> oh yeah it works I am getting the expected value in o.param.

Where is o.param set? You didn't show that in your cut-down code...

> > > 
> > > 
> > >
> > > 
> > > #request.actionpasser#
> > >
> > > 
> > > 
> > > 
-- 
Sean A Corfield -- http://www.corfield.org/
Team Fusebox -- http://www.fusebox.org/
Got Gmail? -- I have 1 invite

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

~|
Sams Teach Yourself Regular Expressions in 10 Minutes  by Ben Forta 
http://www.houseoffusion.com/banners/view.cfm?bannerid=40

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:183325
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: How to use Request scope?!

2004-11-03 Thread Ian Sheridan
oh yeah it works I am getting the expected value in o.param.


On Wed, 3 Nov 2004 15:15:46 -0800, Sean Corfield <[EMAIL PROTECTED]> wrote:
> Have you checked that o.param contains a valid value?
> 
> 
> 
> On Wed, 3 Nov 2004 14:18:49 -0500, Ian Sheridan <[EMAIL PROTECTED]> wrote:
> > I was getting the "actionpasser" not defined in the Request scope.
> >
> > This is basicly what I am doing:
> >
> > 
> > 
> >
> > 
> > #request.actionpasser#
> >
> > 
> > 
> > 

-- 

--
Ian Sheridan
http://www.savagevines.com
--

~|
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.houseoffusion.com/banners/view.cfm?bannerid=11

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:183318
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: How to use Request scope?!

2004-11-03 Thread Sean Corfield
Have you checked that o.param contains a valid value?

On Wed, 3 Nov 2004 14:18:49 -0500, Ian Sheridan <[EMAIL PROTECTED]> wrote:
> I was getting the "actionpasser" not defined in the Request scope.
> 
> This is basicly what I am doing:
> 
> 
> 
> 
> 
> #request.actionpasser#
> 
> 
> 
> 

~|
Sams Teach Yourself Regular Expressions in 10 Minutes  by Ben Forta 
http://www.houseoffusion.com/banners/view.cfm?bannerid=40

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:183317
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: How to use Request scope?!

2004-11-03 Thread Ewok
That’s pretty strange. I've never seen or heard of it happening before.
Everything seems right to me. What happens when you unscope it? Make it just
actionpasser instead of request.actionpasser.

This would work just the same as it SHOULD when scoped as request. Are you
having nay problems with the request scope anywhere else?

-Original Message-
From: Ian Sheridan [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 03, 2004 2:19 PM
To: CF-Talk
Subject: Re: How to use Request scope?!

I was getting the "actionpasser" not defined in the Request scope.

This is basicly what I am doing:





#request.actionpasser#







On Wed, 3 Nov 2004 14:08:51 -0500, Ewok <[EMAIL PROTECTED]> wrote:
> Same here... I set all my request variables in one file then include it
via
> Application.cfm. the request vars are available anywhere and everywhere
> throughout the entire application this way.
> 
> If you have these two files...
> 
> 
> 
> 
> 
> 
> #request.testvar#
> 
> Index.cfm should just display "request variable"
> 
> This SHOULD definitely work. If it's not, then there is something wrong
> somewhere else. Were you getting test not defined in request scope errors?
> Or any kind of error for that matter...
> 
> 
> 
> -Original Message-
> From: Ben Doom [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, November 03, 2004 1:26 PM
> To: CF-Talk
> Subject: Re: How to use Request scope?!
> 
> Except that I do exactly what you said didn't work all the time.  I
> routinely create request or variable scoped vars in one include to be
> used in another.  The includes are serial, not nested.
> 
> So I don't know what your original problem was, but I'd be careful to
> check and make sure that the value being used in the second include is
> actually what's being set in the first, not in the index.
> 
> --Ben
> 
> Ian Sheridan wrote:
> > Well let me be a little bit more descriptive.
> >
> > I have an "index.cfm" page that includes two files. I was then setting
> > the REQUEST variable *in* the first include. In the second include I
> > would then look for it. This did not work.
> >
> > I now set the REQUEST variable in the "index.cfm" file first. Then set
> > it in the first include and read it in the second include. This works.
> >
> > So I gather from this experience that request is *inherited* from the
> > parent document.
> >
> > Application.cfm
> > - index.cfm
> > -- include.cfm
> >
> > It only gets inherited. there is no creating it in a child include/file.
> >
> > Ian
> 
> 



~|
Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF 
community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=38

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:183313
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: How to use Request scope?!

2004-11-03 Thread Ian Sheridan
I was getting the "actionpasser" not defined in the Request scope.

This is basicly what I am doing:





#request.actionpasser#







On Wed, 3 Nov 2004 14:08:51 -0500, Ewok <[EMAIL PROTECTED]> wrote:
> Same here... I set all my request variables in one file then include it via
> Application.cfm. the request vars are available anywhere and everywhere
> throughout the entire application this way.
> 
> If you have these two files...
> 
> 
> 
> 
> 
> 
> #request.testvar#
> 
> Index.cfm should just display "request variable"
> 
> This SHOULD definitely work. If it's not, then there is something wrong
> somewhere else. Were you getting test not defined in request scope errors?
> Or any kind of error for that matter...
> 
> 
> 
> -Original Message-
> From: Ben Doom [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, November 03, 2004 1:26 PM
> To: CF-Talk
> Subject: Re: How to use Request scope?!
> 
> Except that I do exactly what you said didn't work all the time.  I
> routinely create request or variable scoped vars in one include to be
> used in another.  The includes are serial, not nested.
> 
> So I don't know what your original problem was, but I'd be careful to
> check and make sure that the value being used in the second include is
> actually what's being set in the first, not in the index.
> 
> --Ben
> 
> Ian Sheridan wrote:
> > Well let me be a little bit more descriptive.
> >
> > I have an "index.cfm" page that includes two files. I was then setting
> > the REQUEST variable *in* the first include. In the second include I
> > would then look for it. This did not work.
> >
> > I now set the REQUEST variable in the "index.cfm" file first. Then set
> > it in the first include and read it in the second include. This works.
> >
> > So I gather from this experience that request is *inherited* from the
> > parent document.
> >
> > Application.cfm
> > - index.cfm
> > -- include.cfm
> >
> > It only gets inherited. there is no creating it in a child include/file.
> >
> > Ian
> 
> 

~|
Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF 
community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=35

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:183306
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: How to use Request scope?!

2004-11-03 Thread Ben Doom
It shouldn't matter what version.  Request variables worked the way 
documented in 5, I know from experience.  They should work in 6.0 just fine.

But that raises the question of why you're running 6.0 instead of 6.1 
with updaters.  Is there are reason?  If not, you should definately 
update -- there are a number of security and performance fixes.

--Ben

Ian Sheridan wrote:
> Oh it is passing the right info but maybe it's because I am doing this
> on a 6.0 machine
> 
> Ian
> 
> On Wed, 03 Nov 2004 13:25:35 -0500, Ben Doom <[EMAIL PROTECTED]> wrote:
> 
>>Except that I do exactly what you said didn't work all the time.  I
>>routinely create request or variable scoped vars in one include to be
>>used in another.  The includes are serial, not nested.
>>
>>So I don't know what your original problem was, but I'd be careful to
>>check and make sure that the value being used in the second include is
>>actually what's being set in the first, not in the index.
>>
>>--Ben


~|
Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF 
community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=34

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:183303
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: How to use Request scope?!

2004-11-03 Thread Ewok
Same here... I set all my request variables in one file then include it via
Application.cfm. the request vars are available anywhere and everywhere
throughout the entire application this way.

If you have these two files...






#request.testvar#


Index.cfm should just display "request variable"

This SHOULD definitely work. If it's not, then there is something wrong
somewhere else. Were you getting test not defined in request scope errors?
Or any kind of error for that matter...

-Original Message-
From: Ben Doom [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 03, 2004 1:26 PM
To: CF-Talk
Subject: Re: How to use Request scope?!

Except that I do exactly what you said didn't work all the time.  I 
routinely create request or variable scoped vars in one include to be 
used in another.  The includes are serial, not nested.

So I don't know what your original problem was, but I'd be careful to 
check and make sure that the value being used in the second include is 
actually what's being set in the first, not in the index.

--Ben

Ian Sheridan wrote:
> Well let me be a little bit more descriptive. 
> 
> I have an "index.cfm" page that includes two files. I was then setting
> the REQUEST variable *in* the first include. In the second include I
> would then look for it. This did not work.
> 
> I now set the REQUEST variable in the "index.cfm" file first. Then set
> it in the first include and read it in the second include. This works.
> 
> So I gather from this experience that request is *inherited* from the
> parent document.
> 
> Application.cfm
> - index.cfm
> -- include.cfm
> 
> It only gets inherited. there is no creating it in a child include/file.
> 
> Ian




~|
Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF 
community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=37

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:183301
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: How to use Request scope?!

2004-11-03 Thread Ian Sheridan
Oh it is passing the right info but maybe it's because I am doing this
on a 6.0 machine

Ian

On Wed, 03 Nov 2004 13:25:35 -0500, Ben Doom <[EMAIL PROTECTED]> wrote:
> Except that I do exactly what you said didn't work all the time.  I
> routinely create request or variable scoped vars in one include to be
> used in another.  The includes are serial, not nested.
> 
> So I don't know what your original problem was, but I'd be careful to
> check and make sure that the value being used in the second include is
> actually what's being set in the first, not in the index.
> 
> --Ben
> 
> 
> 
> Ian Sheridan wrote:
> > Well let me be a little bit more descriptive.
> >
> > I have an "index.cfm" page that includes two files. I was then setting
> > the REQUEST variable *in* the first include. In the second include I
> > would then look for it. This did not work.
> >
> > I now set the REQUEST variable in the "index.cfm" file first. Then set
> > it in the first include and read it in the second include. This works.
> >
> > So I gather from this experience that request is *inherited* from the
> > parent document.
> >
> > Application.cfm
> > - index.cfm
> > -- include.cfm
> >
> > It only gets inherited. there is no creating it in a child include/file.
> >
> > Ian
> 
> 
> 

~|
Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF 
community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=38

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:183294
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: How to use Request scope?!

2004-11-03 Thread Adam Haskell
A request scope can be set anywere and is available anywhere during a
request. However its bad coding practice to use it in CFCs and what
not but as far as I can tell it can be done.

Adam 


On Wed, 03 Nov 2004 13:25:35 -0500, Ben Doom <[EMAIL PROTECTED]> wrote:
> Except that I do exactly what you said didn't work all the time.  I
> routinely create request or variable scoped vars in one include to be
> used in another.  The includes are serial, not nested.
> 
> So I don't know what your original problem was, but I'd be careful to
> check and make sure that the value being used in the second include is
> actually what's being set in the first, not in the index.
> 
> --Ben
> 
> 
> 
> Ian Sheridan wrote:
> > Well let me be a little bit more descriptive.
> >
> > I have an "index.cfm" page that includes two files. I was then setting
> > the REQUEST variable *in* the first include. In the second include I
> > would then look for it. This did not work.
> >
> > I now set the REQUEST variable in the "index.cfm" file first. Then set
> > it in the first include and read it in the second include. This works.
> >
> > So I gather from this experience that request is *inherited* from the
> > parent document.
> >
> > Application.cfm
> > - index.cfm
> > -- include.cfm
> >
> > It only gets inherited. there is no creating it in a child include/file.
> >
> > Ian
> 
> 
> 

~|
Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF 
community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=35

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:183293
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: How to use Request scope?!

2004-11-03 Thread Ben Doom
Except that I do exactly what you said didn't work all the time.  I 
routinely create request or variable scoped vars in one include to be 
used in another.  The includes are serial, not nested.

So I don't know what your original problem was, but I'd be careful to 
check and make sure that the value being used in the second include is 
actually what's being set in the first, not in the index.

--Ben

Ian Sheridan wrote:
> Well let me be a little bit more descriptive. 
> 
> I have an "index.cfm" page that includes two files. I was then setting
> the REQUEST variable *in* the first include. In the second include I
> would then look for it. This did not work.
> 
> I now set the REQUEST variable in the "index.cfm" file first. Then set
> it in the first include and read it in the second include. This works.
> 
> So I gather from this experience that request is *inherited* from the
> parent document.
> 
> Application.cfm
> - index.cfm
> -- include.cfm
> 
> It only gets inherited. there is no creating it in a child include/file.
> 
> Ian


~|
Sams Teach Yourself Regular Expressions in 10 Minutes  by Ben Forta 
http://www.houseoffusion.com/banners/view.cfm?bannerid=40

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:183292
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: How to use Request scope?!

2004-11-03 Thread Ian Sheridan
Well let me be a little bit more descriptive. 

I have an "index.cfm" page that includes two files. I was then setting
the REQUEST variable *in* the first include. In the second include I
would then look for it. This did not work.

I now set the REQUEST variable in the "index.cfm" file first. Then set
it in the first include and read it in the second include. This works.

So I gather from this experience that request is *inherited* from the
parent document.

Application.cfm
- index.cfm
-- include.cfm

It only gets inherited. there is no creating it in a child include/file.

Ian


On Wed, 03 Nov 2004 13:05:25 -0500, Ben Doom <[EMAIL PROTECTED]> wrote:
> It sounds like it wasn't always being set in the first include.
> 
> Regardless of what file a request variable is set in, it is available to
> all subsequent code.  I may be off a bit with regard to CFCs, but that's
> how I understand it.
> 
> --Ben
> 
> 
> 
> Ian Sheridan wrote:
> > well that's the thing I am setting it in include not the index.cfm file.
> >
> > so I created it in the index.cfm file NOT the included file and it now works.
> >
> > Ian
> >
> >>Sure, as long as you set it before you call it of course
> >>
> >>-Original Message-
> >>
> >>can you set a request scope variable in an include?
> >>
> >>ex.
> >>-index.cfm
> >>--include1.cfm --> set request.test
> >>--include2.cfm --> read request.test
> >>
> >>can this be done?
> 
> 
> 

~|
Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF 
community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=38

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:183289
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: How to use Request scope?!

2004-11-03 Thread Ben Doom
It sounds like it wasn't always being set in the first include.

Regardless of what file a request variable is set in, it is available to 
all subsequent code.  I may be off a bit with regard to CFCs, but that's 
how I understand it.

--Ben

Ian Sheridan wrote:
> well that's the thing I am setting it in include not the index.cfm file.
> 
> so I created it in the index.cfm file NOT the included file and it now works.
> 
> Ian
> 
>>Sure, as long as you set it before you call it of course
>>
>>-----Original Message-
>>
>>can you set a request scope variable in an include?
>>
>>ex.
>>-index.cfm
>>--include1.cfm --> set request.test
>>--include2.cfm --> read request.test
>>
>>can this be done?


~|
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.houseoffusion.com/banners/view.cfm?bannerid=11

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:183286
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: How to use Request scope?!

2004-11-03 Thread Ian Sheridan
well that's the thing I am setting it in include not the index.cfm file.

so I created it in the index.cfm file NOT the included file and it now works.

Ian

On Wed, 3 Nov 2004 12:41:26 -0500, Ewok <[EMAIL PROTECTED]> wrote:
> Sure, as long as you set it before you call it of course
> 
> 
> 
> -Original Message-
> From: Ian Sheridan [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, November 03, 2004 12:38 PM
> To: CF-Talk
> Subject: How to use Request scope?!
> 
> can you set a request scope variable in an include?
> 
> ex.
> -index.cfm
> --include1.cfm --> set request.test
> --include2.cfm --> read request.test
> 
> can this be done?
> 
> --
> 
> --
> Ian Sheridan
> http://www.savagevines.com
> 
> 
> 

~|
Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF 
community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=36

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:183285
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: How to use Request scope?!

2004-11-03 Thread Ewok
Sure, as long as you set it before you call it of course

-Original Message-
From: Ian Sheridan [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 03, 2004 12:38 PM
To: CF-Talk
Subject: How to use Request scope?!

can you set a request scope variable in an include?

ex.
-index.cfm
--include1.cfm --> set request.test
--include2.cfm --> read request.test

can this be done?

-- 

--
Ian Sheridan
http://www.savagevines.com


~|
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.houseoffusion.com/banners/view.cfm?bannerid=11

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:183279
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


How to use Request scope?!

2004-11-03 Thread Ian Sheridan
can you set a request scope variable in an include?

ex.
-index.cfm
--include1.cfm --> set request.test
--include2.cfm --> read request.test

can this be done?

-- 

--
Ian Sheridan
http://www.savagevines.com
--

~|
Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF 
community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=37

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:183276
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: request scope question

2004-10-29 Thread Pascal Peters
request.queryName becomes a pointer to the "queryName" recordset. You
can now access and modify anything in queryName through the reference
request.queryName.
SO yes, you can access "request.queryName.column1" (and it is identical
to "queryName.column1")

Pascal

> -Original Message-
> From: G [mailto:[EMAIL PROTECTED]
> Sent: 28 October 2004 19:02
> To: CF-Talk
> Subject: request scope question
> 
> Been away too long...
> 
> What does the following block of code assign to the
"request.queryName"
> variable??
> 
> 
> SELECT column1, column2
> FROM table
> 
> 
> 
> 
> Can i now access "request.queryName.column1" ?
> 
> TIA,
> Brian
> 
> 
> 
> 

~|
Sams Teach Yourself Regular Expressions in 10 Minutes  by Ben Forta 
http://www.houseoffusion.com/banners/view.cfm?bannerid=40

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:182908
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: request scope question

2004-10-28 Thread Barney Boisvert
It assigns the recordset as a whole.  request.queryName.column1 should
return the value of column1 in the first row of the recordset.

cheers,
barneyb

On Thu, 28 Oct 2004 12:02:04 -0500, G <[EMAIL PROTECTED]> wrote:
> Been away too long...
> 
> What does the following block of code assign to the "request.queryName" variable??
> 
> 
> SELECT column1, column2
> FROM table
> 
> 
> 
> 
> Can i now access "request.queryName.column1" ?
> 
> TIA,
> Brian
-- 
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/blog/

I currently have 0 GMail invites for the taking

~|
Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF 
community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=36

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:182847
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


request scope question

2004-10-28 Thread G
Been away too long...

What does the following block of code assign to the "request.queryName" variable??


SELECT column1, column2
FROM table




Can i now access "request.queryName.column1" ?

TIA,
Brian



~|
Protect your mail server with built in anti-virus protection. It's not only good for 
you, it's good for everybody.
http://www.houseoffusion.com/banners/view.cfm?bannerid=39

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:182846
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: request scope and grouped output

2004-09-03 Thread S . Isaac Dealey
> Hi All,

> I have a table that I would like to replicate each time
> the output loops
> through, based on grouping. However, within the table
> there are outputs
> that call to the request scope variables. That in turn
> throws an error as
> the request scope variables aren't a part of the grouped
> query's record
> set.

> Help?

I'm not sure I understand what you're describing. Can you post your
code and the error?

s. isaac dealey 954.927.5117
new epoch : isn't it time for a change?

add features without fixtures with
the onTap open source framework

http://www.sys-con.com/story/?storyid=44477&DE=1
http://www.sys-con.com/story/?storyid=45569&DE=1
http://www.fusiontap.com
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




Re: request scope and grouped output

2004-09-03 Thread Barney Boisvert
You can definitely call request-scoped variables from inside loops. 
Are you scoping the variable call with "request."?

cheers,
barneyb

On Fri, 3 Sep 2004 13:46:11 -0400, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> Hi All,
> 
> I have a table that I would like to replicate each time the output loops
> through, based on grouping. However, within the table there are outputs
> that call to the request scope variables. That in turn throws an error as
> the request scope variables aren't a part of the grouped query's record
> set.
> 
> Help?
> 

-- 
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




request scope and grouped output

2004-09-03 Thread guy . mcdowell
Hi All,

I have a table that I would like to replicate each time the output loops
through, based on grouping. However, within the table there are outputs
that call to the request scope variables. That in turn throws an error as
the request scope variables aren't a part of the grouped query's record
set.

Help?
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




RE: request scope in cfc... really so bad?

2004-06-18 Thread Simon Stanlake
right,  i guess web service is a good example.
thanks for all the responses.
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




RE: request scope in cfc... really so bad?

2004-06-18 Thread Simon Stanlake
right, i guess web service is a good example.

 
thanks for all the feedback.



	From: Kola Oyedeji [mailto:[EMAIL PROTECTED] 
	Sent: Friday, June 18, 2004 10:17 AM
	To: CF-Talk
	Subject: RE: request scope in cfc... really so bad?
	
	
	Simon 
	
	
	Generally its good for your cfc to be well encapsulated such
that it
	doesn't know anything about its environment. This will make it
more
	re-useable. Consider this - what happens if you need to call the
cfc as
	a web service in future you've just lost that flexibility. If
you have
	no plans to do this and you know that these variables will
always be
	available in *every application* you write then its not a
problem. But
	if you plan to re-use it I would pass the variables in, remember
you can
	put them in a structure and pass them into an initialization
function
	using attributesCollection (I think) although you loose the type
	checking of cfarguement.
	
	
	Hope that helps
	
	
	Kola
	
	
	-Original Message-
	From: Simon Stanlake [mailto:[EMAIL PROTECTED] 
	Sent: 18 June 2004 17:59
	To: CF-Talk
	Subject: RE: request scope in cfc... really so bad?
	
	
	yep, though I guess my question is really, why not use request
scope,
	rather than how to work around it. There are probably lots of
ways to do
	it without using request scope, but request seems like the least
	overhead.
	
	
	
	From: Barney Boisvert [mailto:[EMAIL PROTECTED] 
	Sent: Friday, June 18, 2004 9:36 AM
	To: CF-Talk
	Subject: RE: request scope in cfc... really so bad?
	
	Why not make a configuration CFC (basically an encapsulated
	struct), that
	you can pass to all the various CFCs?  Instantiate that CFC into
	the
	application scope, initialize it with the parameters, and then
	pass that
	single course-grained view of the configuration data to each
	individual CFC
	that needs it.
	
	Cheers,
	barneyb
	
	> -Original Message-
	> From: Simon Stanlake [mailto:[EMAIL PROTECTED] 
	> Sent: Friday, June 18, 2004 9:29 AM
	> To: CF-Talk
	> Subject: request scope in cfc... really so bad?
	> 
	> Thoughts?
	> 
	> If CFCs were EJBs, you would have external config info that
	you would
	> look up using JNDI (or something, I'm not quite up to snuff on
	J2EE).
	> Let's say I am careful and create well named variables like...
	> 
	> request..datasource = "MyDatasource";
	> request..timeout = 300;
	> 
	> etc, all in one file called .cfm that is included in
	> application.cfm. Contract with the developer is you have to
	include
	> .cfm in your application.cfm before calling the CFC. 
	> Am I such
	> a bad guy?
	> 
	> I guess worst case scenario is Macromedia decides not to 
	> support it one
	> day, but I haven't heard anything about that. It's just such a
	pain if
	> there's 10 variables in your app that are required by 10 
	> different CFCs,
	> passing them in as args to the constructor seems awkward.
	> 
	> 
	
	  _ 

 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




RE: request scope in cfc... really so bad?

2004-06-18 Thread Kola Oyedeji
Simon 

 
Generally its good for your cfc to be well encapsulated such that it
doesn't know anything about its environment. This will make it more
re-useable. Consider this - what happens if you need to call the cfc as
a web service in future you've just lost that flexibility. If you have
no plans to do this and you know that these variables will always be
available in *every application* you write then its not a problem. But
if you plan to re-use it I would pass the variables in, remember you can
put them in a structure and pass them into an initialization function
using attributesCollection (I think) although you loose the type
checking of cfarguement.

 
Hope that helps

 
Kola

 
-Original Message-
From: Simon Stanlake [mailto:[EMAIL PROTECTED] 
Sent: 18 June 2004 17:59
To: CF-Talk
Subject: RE: request scope in cfc... really so bad?

 
yep, though I guess my question is really, why not use request scope,
rather than how to work around it. There are probably lots of ways to do
it without using request scope, but request seems like the least
overhead.



From: Barney Boisvert [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 18, 2004 9:36 AM
To: CF-Talk
Subject: RE: request scope in cfc... really so bad?

Why not make a configuration CFC (basically an encapsulated
struct), that
you can pass to all the various CFCs?  Instantiate that CFC into
the
application scope, initialize it with the parameters, and then
pass that
single course-grained view of the configuration data to each
individual CFC
that needs it.

Cheers,
barneyb

> -Original Message-
> From: Simon Stanlake [mailto:[EMAIL PROTECTED] 
> Sent: Friday, June 18, 2004 9:29 AM
> To: CF-Talk
> Subject: request scope in cfc... really so bad?
> 
> Thoughts?
> 
> If CFCs were EJBs, you would have external config info that
you would
> look up using JNDI (or something, I'm not quite up to snuff on
J2EE).
> Let's say I am careful and create well named variables like...
> 
> request..datasource = "MyDatasource";
> request..timeout = 300;
> 
> etc, all in one file called .cfm that is included in
> application.cfm. Contract with the developer is you have to
include
> .cfm in your application.cfm before calling the CFC. 
> Am I such
> a bad guy?
> 
> I guess worst case scenario is Macromedia decides not to 
> support it one
> day, but I haven't heard anything about that. It's just such a
pain if
> there's 10 variables in your app that are required by 10 
> different CFCs,
> passing them in as args to the constructor seems awkward.
> 
> 

  _
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




RE: request scope in cfc... really so bad?

2004-06-18 Thread Simon Stanlake
yep, though I guess my question is really, why not use request scope,
rather than how to work around it. There are probably lots of ways to do
it without using request scope, but request seems like the least
overhead.



	From: Barney Boisvert [mailto:[EMAIL PROTECTED] 
	Sent: Friday, June 18, 2004 9:36 AM
	To: CF-Talk
	Subject: RE: request scope in cfc... really so bad?
	
	
	Why not make a configuration CFC (basically an encapsulated
struct), that
	you can pass to all the various CFCs?  Instantiate that CFC into
the
	application scope, initialize it with the parameters, and then
pass that
	single course-grained view of the configuration data to each
individual CFC
	that needs it.
	
	Cheers,
	barneyb
	
	> -Original Message-
	> From: Simon Stanlake [mailto:[EMAIL PROTECTED] 
	> Sent: Friday, June 18, 2004 9:29 AM
	> To: CF-Talk
	> Subject: request scope in cfc... really so bad?
	> 
	> Thoughts?
	> 
	> If CFCs were EJBs, you would have external config info that
you would
	> look up using JNDI (or something, I'm not quite up to snuff on
J2EE).
	> Let's say I am careful and create well named variables like...
	> 
	> request..datasource = "MyDatasource";
	> request..timeout = 300;
	> 
	> etc, all in one file called .cfm that is included in
	> application.cfm. Contract with the developer is you have to
include
	> .cfm in your application.cfm before calling the CFC. 
	> Am I such
	> a bad guy?
	> 
	> I guess worst case scenario is Macromedia decides not to 
	> support it one
	> day, but I haven't heard anything about that. It's just such a
pain if
	> there's 10 variables in your app that are required by 10 
	> different CFCs,
	> passing them in as args to the constructor seems awkward.
	> 
	> 

 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




RE: request scope in cfc... really so bad?

2004-06-18 Thread Barney Boisvert
Why not make a configuration CFC (basically an encapsulated struct), that
you can pass to all the various CFCs?  Instantiate that CFC into the
application scope, initialize it with the parameters, and then pass that
single course-grained view of the configuration data to each individual CFC
that needs it.

Cheers,
barneyb

> -Original Message-
> From: Simon Stanlake [mailto:[EMAIL PROTECTED] 
> Sent: Friday, June 18, 2004 9:29 AM
> To: CF-Talk
> Subject: request scope in cfc... really so bad?
> 
> Thoughts?
> 
> If CFCs were EJBs, you would have external config info that you would
> look up using JNDI (or something, I'm not quite up to snuff on J2EE).
> Let's say I am careful and create well named variables like...
> 
> request..datasource = "MyDatasource";
> request..timeout = 300;
> 
> etc, all in one file called .cfm that is included in
> application.cfm. Contract with the developer is you have to include
> .cfm in your application.cfm before calling the CFC. 
> Am I such
> a bad guy?
> 
> I guess worst case scenario is Macromedia decides not to 
> support it one
> day, but I haven't heard anything about that. It's just such a pain if
> there's 10 variables in your app that are required by 10 
> different CFCs,
> passing them in as args to the constructor seems awkward.
> 
>
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




request scope in cfc... really so bad?

2004-06-18 Thread Simon Stanlake
Thoughts?

If CFCs were EJBs, you would have external config info that you would
look up using JNDI (or something, I'm not quite up to snuff on J2EE).
Let's say I am careful and create well named variables like...

request..datasource = "MyDatasource";
request..timeout = 300;

etc, all in one file called .cfm that is included in
application.cfm. Contract with the developer is you have to include
.cfm in your application.cfm before calling the CFC. Am I such
a bad guy?

I guess worst case scenario is Macromedia decides not to support it one
day, but I haven't heard anything about that. It's just such a pain if
there's 10 variables in your app that are required by 10 different CFCs,
passing them in as args to the constructor seems awkward.
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]
 [Donations and Support]




RE: request scope combined with application???

2004-06-14 Thread Joe Rinehart
I'd take a look at what the secLoginStatus() function is doing - is it
referring to something (a structure, component, etc.) in the session
scope that'd be returned by reference, and the members assigned inside
of Request.Session are being made to point to something residing in
session?

 
-joe

 
-Original Message-
From: [EMAIL PROTECTED] [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 14, 2004 12:33 PM
To: CF-Talk
Subject: request scope combined with application???

 
Could someone tell me the benefits of having variables in a request
scope and in a structure loaded in the application page like below:

 



I'm suspicious these are persistent scopes loaded into request scope
since I also found this:





I understand using the request scope for dsns etc., but I don't
understand using the request scope with structures or as the notes say,
application scope (hope to find that soon!).  It would seem to be
inefficient and defeat the purpose to load these values into both a
persistent scope and a non-persistent scope.  If these really are just a
structure in the request scope, I still would think it's unnecessary
complexity if not inefficient.  Could some one enlighten me on any
merits of doing it this way or confirm the inefficiencies?  Is this
somehow a trick to eliminate the need to lock variables?
  _
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




request scope combined with application???

2004-06-14 Thread bbetts
Could someone tell me the benefits of having variables in a request scope and in a structure loaded in the application page like below:

	



I'm suspicious these are persistent scopes loaded into request scope since I also found this:

	
	
	

I understand using the request scope for dsns etc., but I don't understand using the request scope with structures or as the notes say, application scope (hope to find that soon!).  It would seem to be inefficient and defeat the purpose to load these values into both a persistent scope and a non-persistent scope.  If these really are just a structure in the request scope, I still would think it's unnecessary complexity if not inefficient.  Could some one enlighten me on any merits of doing it this way or confirm the inefficiencies?  Is this somehow a trick to eliminate the need to lock variables?
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Application vs Request scope

2004-04-23 Thread Dave Watts
> Which is more readable?
> 
> #createTimeSpan(0, 0, 0, 10)#
> 0.000115741
> 
> Sure, the execution time is slightly less for the latter, but 
> if you care about that last few microseconds, I'd highly 
> recommend dumping CF for assembler.  The beauty of CF is that 
> it's really easy to learn, code, read and maintain.  Doing 
> little "tricks" like that only detracts.  
> 
> And that's not even addressing the issue that there is almost 
> guarenteed to be somewhere that you can tweak a few lines of 
> SQL, or add an index somewhere and save several (perhaps tens 
> of) milliseconds a request.

Amen, brother!

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Application vs Request scope

2004-04-23 Thread Barney Boisvert
Which is more readable?

#createTimeSpan(0, 0, 0, 10)#
0.000115741

Sure, the execution time is slightly less for the latter, but if you care
about that last few microseconds, I'd highly recommend dumping CF for
assembler.  The beauty of CF is that it's really easy to learn, code, read
and maintain.  Doing little "tricks" like that only detracts.  

And that's not even addressing the issue that there is almost guarenteed to
be somewhere that you can tweak a few lines of SQL, or add an index
somewhere and save several (perhaps tens of) milliseconds a request.

Cheers,
barneyb

> -Original Message-
> From: Thomas Chiverton [mailto:[EMAIL PROTECTED] 
> Sent: Friday, April 23, 2004 8:29 AM
> To: CF-Talk
> Subject: Re: Application vs Request scope
> 
> On Friday 23 Apr 2004 16:17 pm, Matt Robertson wrote:
> > 	cachedwithin="#CreateTimeSpan(0,0,0,10)#">
> 
> Just a quickie, but you can put a fractional day here, rather 
> than doing a 
> createTimeSpan() for every page request.
> cfdump a createTimeSpan call to see what I mean.
> 
> -- 
> Tom Chiverton 
> Advanced ColdFusion Programmer
> 
> Tel: +44(0)1749 834997
> email: [EMAIL PROTECTED]
> BlueFinger Limited
> Underwood Business Park
> Wookey Hole Road, WELLS. BA5 1AF
> Tel: +44 (0)1749 834900
> Fax: +44 (0)1749 834901
> web: www.bluefinger.com
> Company Reg No: 4209395 Registered Office: 2 Temple Back East, Temple
> Quay, BRISTOL. BS1 6EG.
> *** This E-mail contains confidential information for the addressee
> only. If you are not the intended recipient, please notify us
> immediately. You should not use, disclose, distribute or copy this
> communication if received in error. No binding contract will 
> result from
> this e-mail until such time as a written document is signed 
> on behalf of
> the company. BlueFinger Limited cannot accept responsibility for the
> completeness or accuracy of this message as it has been 
> transmitted over
> public networks.***
> 
>
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Application vs Request scope

2004-04-23 Thread Matt Robertson
Thomas Chiverton wrote:
>you can put a fractional day here, rather than doing a 
>createTimeSpan() for every page request.

Yes, ever since Michael posted that on HoF I've been doing it, and it
makes a lot of sense.  I still use CreateTimeSpan when I plug in
parameters instead of hardcoding the expiration value, where I'll use
that same parameter value somewhere else as well (like a datecompare
statement).


 Matt Robertson   [EMAIL PROTECTED] 
 MSB Designs, Inc.  http://mysecretbase.com

 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: Application vs Request scope

2004-04-23 Thread Thomas Chiverton
On Friday 23 Apr 2004 16:17 pm, Matt Robertson wrote:
> 	cachedwithin="#CreateTimeSpan(0,0,0,10)#">

Just a quickie, but you can put a fractional day here, rather than doing a 
createTimeSpan() for every page request.
cfdump a createTimeSpan call to see what I mean.

-- 
Tom Chiverton 
Advanced ColdFusion Programmer

Tel: +44(0)1749 834997
email: [EMAIL PROTECTED]
BlueFinger Limited
Underwood Business Park
Wookey Hole Road, WELLS. BA5 1AF
Tel: +44 (0)1749 834900
Fax: +44 (0)1749 834901
web: www.bluefinger.com
Company Reg No: 4209395 Registered Office: 2 Temple Back East, Temple
Quay, BRISTOL. BS1 6EG.
*** This E-mail contains confidential information for the addressee
only. If you are not the intended recipient, please notify us
immediately. You should not use, disclose, distribute or copy this
communication if received in error. No binding contract will result from
this e-mail until such time as a written document is signed on behalf of
the company. BlueFinger Limited cannot accept responsibility for the
completeness or accuracy of this message as it has been transmitted over
public networks.***
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Application vs Request scope

2004-04-23 Thread Matt Robertson
p.s. leave that silly maxrows statement out.

--Matt--
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Application vs Request scope

2004-04-23 Thread Matt Robertson
Spectrum Web Design wrote:
>Hi Matt. Do you can share this technique about 
>store application/request vars in DB ? Interesting...

Sure, but given CF 6+'s handling of shared memory vars, I wouldn't
consider this unless you are on CF 5 or need to be compatible with it.
Anyway...

I have a table named Settings with, lets say, the following fields and
contents:

Settings.BaseHRef  (http://foo.com)
Settings.SecureHRef  (https://www.foo.com)
Settings.BasePath  (d:\web\foo)
Settings.BGColor  (##ff)

Then I put this in Application.cfm:

	name="Settings" 
	datasource="#request.myDSN#" 
	maxrows="1" 
	cachedwithin="#CreateTimeSpan(0,0,0,10)#">
	SELECT
		Settings.BaseHRef,
		Settings.SecureHRef,
		Settings.BasePath,
		Settings.BGColor
	FROM Settings
	WHERE 
		Settings.PrimaryKey='#SomeValue#'


Then when I need to pull, say, the BGColor value I reference
Settings.BGColor, or pass it to whatever I'm calling.

I set this to 10 seconds, but it can be any other value you care to
name.  

HtH,


 Matt Robertson   [EMAIL PROTECTED] 
 MSB Designs, Inc.  http://mysecretbase.com

 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: Application vs Request scope

2004-04-23 Thread Spectrum Web
Hi Matt. Do you can share this technique about store application/request vars in DB ? Interesting...

> I use request scope.  Declaration is short and simple.  No resource 
> drain noticeable.
> 
> Are all shared scope reads safe to no lock now?  I thought it was only 
> session var reads that were completely safe.
> 
> Another thing I use a lot of is a cached db query.  I'll have a table 
> with a structure that has a bunch o' fields.  One record per site, 
> typically.  Even the biggest settings tables have no more than 1/2 
> dozen records, so the query is fast.  Cache it for say 10 seconds and 
> you have the ability to update the db in almost real time while at the 
> same time saving yourself a lot of locks, or req var resets.  If no 
> updates, then cache it for 10 hours or something equally palatable.  
> YMMV.
> 
> 
> --
> ---

 
> Matt Robertson, [EMAIL PROTECTED]

 
> MSB Designs, Inc. http://mysecretbase.com
> ---
> 
--
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Application vs Request scope

2004-04-22 Thread Jim Davis
On CF 5 and below I use the request scope.  No locking is required, but you
do have multiple copies of the same information using resources (although no
more copies than allowable threads on the server).  For large data sets or
data which takes a while to fetch (queries) I use the Application scope with
proper locking.

On MX I use the Application scope.  Locking for global variables (write
once, read many) can be safely ignored.

Jim Davis

  _  

From: Chris Alvarado [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 22, 2004 4:28 PM
To: CF-Talk
Subject: Application vs Request scope

Hello all,

I've been doing CF development for quite some time and as such im fairly
set on the way I do things. However I just had a debate with another
developer regarding which scope was proper for setting application wide
variable (such as DSN names, file paths etc) in regards to locking /
efficiency etc.

What is everyone's preference and why?

I typically use the application scope with proper locking during
declaration. . . 

Is that the "correct" way or is request scope the preferred method and
why?

Thanks everyone,

-chris.alvarado

[ application developer ]

4 Guys Interactive, Inc.

281.807.4344 x1716

  _
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Application vs Request scope

2004-04-22 Thread Barney Boisvert
Here's an algorithm succeptable to a race condition:

Check the inventory for a part
Record a sale of that part, deducting the number sold from the inventory
count

Here's the chain of events that demonstrates:

Clerk A checks the inventory system for part #1138 and there are 3 left
Clerk B checks the inventory system for part #1138 and there are 3 left
Clerk A records a sale of one part, updating inventory to 2 (3-1)
Clerk B records a sale of two parts, updating inventory to 1 (3-2)

The system says there is 1 left, but all three were sold.  That's a race
condition.  With locking, clerk B can't check the inventory until clerk A
finishes his update, so he'll read the value '2' not '3', and the system
will stay in sync.

Here's another:

If (NOT structKeyExists(application, "myThing")) {
  Application.myThing = createObject("component", "path.to.cfc");
  Application.myThing.init();
}
Application.myThing.doMethod();

And the chain of events:

Req1: structKeyExists() - no
Req1: createObject()
Req2: structKeyExists() - yes
Req2: doMethod()
Req1: init();
Req1: doMethod();

Notice the first doMethod() call is before the cfc's init() method is
called.  Legal, but usually not what you want at all.

Cheers,
barneyb

> -Original Message-
> From: Chris Alvarado [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, April 22, 2004 2:12 PM
> To: CF-Talk
> Subject: RE: Application vs Request scope
> 
> Can you please describe a race condition to me?
> 
>  
> 
> I know what it means conceptually, basically when you have one thing
> that needs to happen before another an not simultaneously, but I cant
> really think of an instance where this would be the case.
> 
>  
> 
> Thanks again,
> 
>  
> 
> -chris.alvarado
> 
> [ application developer ]
> 
> 4 Guys Interactive, Inc.
> 
> 281.807.4344 x1716
> 
>  
> 
>  
> 
>   _  
> 
> From: Barney Boisvert [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, April 22, 2004 3:57 PM
> To: CF-Talk
> Subject: RE: Application vs Request scope
> 
>  
> 
> > Are all shared scope reads safe to no lock now?  I thought it 
> > was only session var reads that were completely safe.
> 
> In CFMX, everything is completely safe to use without any 
> locking.  You
> only
> ever need to lock for race conditions. 
> 
> > Another thing I use a lot of is a cached db query.
> 
> This can generally be accomplished better by the DB (if your 
> DB supports
> it;
> I use MySQL which does, I don't know about others), or by some kind of
> intelligent cache.  For simple stuff cachedWithin works well, but when
> you
> need more control than a simple delay, an encapsulated CFC (or better
> yet, a
> general purpose cache) stored in the application scope is usually a
> better
> way to go, IMHO.
> 
> Best of all would be an encapsulated persistance mechanism, 
> because then
> you
> can cache with INSANE aggresiveness, because that single interface has
> all
> updates passing through it, which means you know exactly when you have
> to
> flush, and you never flush when it's not needed.
> 
> Cheers,
> barneyb
> 
> > -Original Message-
> > From: Matt Robertson [mailto:[EMAIL PROTECTED] 
> > Sent: Thursday, April 22, 2004 1:48 PM
> > To: CF-Talk
> > Subject: Re: Application vs Request scope
> > 
> > I use request scope.  Declaration is short and simple.  No 
> > resource drain noticeable.
> > 
> > 
> > Another thing I use a lot of is a cached db query.  I'll have 
> > a table with a structure that has a bunch o' fields.  One 
> > record per site, typically.  Even the biggest settings tables 
> > have no more than 1/2 dozen records, so the query is fast.  
> > Cache it for say 10 seconds and you have the ability to 
> > update the db in almost real time while at the same time 
> > saving yourself a lot of locks, or req var resets.  If no 
> > updates, then cache it for 10 hours or something equally 
> > palatable.  YMMV.
> > 
> > 
> > --
> > ---
> >  Matt Robertson, [EMAIL PROTECTED]
> >  MSB Designs, Inc. http://mysecretbase.com
> > ---
> > 
> > --
> > 
> >
> 
>   _  
> 
> 
> 
>
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: Application vs Request scope

2004-04-22 Thread Jochem van Dieten
Chris Alvarado wrote:
> Can you please describe a race condition to me?
> 
> I know what it means conceptually, basically when you have one thing
> that needs to happen before another an not simultaneously, but I cant
> really think of an instance where this would be the case.

Imagine the foloowing code:


   


If it is run with the following values, everything goes well:
a = 1
b = 100
c = 1

And with these values, everything works as well:
a = 1000
b = 1
c = -1

But if you run 2 instances, it becomes a mess. Since both loops 
share the same index, one will incrementing the index, and the 
other will decrementing it. If they are both equally fast this 
will effectively become an infinite loop.

Jochem

-- 
I don't get it
immigrants don't work
and steal our jobs
 - Loesje
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Application vs Request scope

2004-04-22 Thread Barney Boisvert
Yep, CF and the underlying Java runtime automatically protects against
memory corruption no matter what and how a variable is used.  So you're 100%
safe from that.

Cheers,
barneyb

> -Original Message-
> From: Matt Robertson [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, April 22, 2004 2:08 PM
> To: CF-Talk
> Subject: RE: Application vs Request scope
> 
> Barney Boisvert wrote:
> >In CFMX, everything is completely safe to use without any locking.  
> >You only ever need to lock for race conditions. 
> 
> *everything* as in reads AND writes?  I could have sworn the 
> rule was reads only.
> 
> OMIGOD I helped propagate another locking thread.  There's 
> only one honorable thing to do.  I'm going over to the office 
> window and
> 
> A*A*A*A*AAAaahh...
> 
> *splat*
> 
>
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Application vs Request scope

2004-04-22 Thread Chris Alvarado
Can you please describe a race condition to me?

I know what it means conceptually, basically when you have one thing
that needs to happen before another an not simultaneously, but I cant
really think of an instance where this would be the case.

Thanks again,

-chris.alvarado

[ application developer ]

4 Guys Interactive, Inc.

281.807.4344 x1716



  _  

From: Barney Boisvert [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 22, 2004 3:57 PM
To: CF-Talk
Subject: RE: Application vs Request scope

> Are all shared scope reads safe to no lock now?  I thought it 
> was only session var reads that were completely safe.

In CFMX, everything is completely safe to use without any locking.  You
only
ever need to lock for race conditions. 

> Another thing I use a lot of is a cached db query.

This can generally be accomplished better by the DB (if your DB supports
it;
I use MySQL which does, I don't know about others), or by some kind of
intelligent cache.  For simple stuff cachedWithin works well, but when
you
need more control than a simple delay, an encapsulated CFC (or better
yet, a
general purpose cache) stored in the application scope is usually a
better
way to go, IMHO.

Best of all would be an encapsulated persistance mechanism, because then
you
can cache with INSANE aggresiveness, because that single interface has
all
updates passing through it, which means you know exactly when you have
to
flush, and you never flush when it's not needed.

Cheers,
barneyb

> -Original Message-
> From: Matt Robertson [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, April 22, 2004 1:48 PM
> To: CF-Talk
> Subject: Re: Application vs Request scope
> 
> I use request scope.  Declaration is short and simple.  No 
> resource drain noticeable.
> 
> 
> Another thing I use a lot of is a cached db query.  I'll have 
> a table with a structure that has a bunch o' fields.  One 
> record per site, typically.  Even the biggest settings tables 
> have no more than 1/2 dozen records, so the query is fast.  
> Cache it for say 10 seconds and you have the ability to 
> update the db in almost real time while at the same time 
> saving yourself a lot of locks, or req var resets.  If no 
> updates, then cache it for 10 hours or something equally 
> palatable.  YMMV.
> 
> 
> --
> ---
>  Matt Robertson, [EMAIL PROTECTED]
>  MSB Designs, Inc. http://mysecretbase.com
> ---
> 
> --
> 
>

  _
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Application vs Request scope

2004-04-22 Thread Matt Robertson
Barney Boisvert wrote:
>In CFMX, everything is completely safe to use without any locking.  
>You only ever need to lock for race conditions. 

*everything* as in reads AND writes?  I could have sworn the rule was reads only.

OMIGOD I helped propagate another locking thread.  There's only one honorable thing to do.  I'm going over to the office window and

A*A*A*A*AAAaahh...

*splat*
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Application vs Request scope

2004-04-22 Thread Raymond Camden
> Are all shared scope reads safe to no lock now?  I thought it 
> was only session var reads that were completely safe.
> 

No, im MX they are all safe - you only have to worry about race conditions.
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Application vs Request scope

2004-04-22 Thread Barney Boisvert
> Are all shared scope reads safe to no lock now?  I thought it 
> was only session var reads that were completely safe.

In CFMX, everything is completely safe to use without any locking.  You only
ever need to lock for race conditions. 

> Another thing I use a lot of is a cached db query.

This can generally be accomplished better by the DB (if your DB supports it;
I use MySQL which does, I don't know about others), or by some kind of
intelligent cache.  For simple stuff cachedWithin works well, but when you
need more control than a simple delay, an encapsulated CFC (or better yet, a
general purpose cache) stored in the application scope is usually a better
way to go, IMHO.

Best of all would be an encapsulated persistance mechanism, because then you
can cache with INSANE aggresiveness, because that single interface has all
updates passing through it, which means you know exactly when you have to
flush, and you never flush when it's not needed.

Cheers,
barneyb

> -Original Message-
> From: Matt Robertson [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, April 22, 2004 1:48 PM
> To: CF-Talk
> Subject: Re: Application vs Request scope
> 
> I use request scope.  Declaration is short and simple.  No 
> resource drain noticeable.
> 
> 
> Another thing I use a lot of is a cached db query.  I'll have 
> a table with a structure that has a bunch o' fields.  One 
> record per site, typically.  Even the biggest settings tables 
> have no more than 1/2 dozen records, so the query is fast.  
> Cache it for say 10 seconds and you have the ability to 
> update the db in almost real time while at the same time 
> saving yourself a lot of locks, or req var resets.  If no 
> updates, then cache it for 10 hours or something equally 
> palatable.  YMMV.
> 
> 
> --
> ---
>  Matt Robertson, [EMAIL PROTECTED]
>  MSB Designs, Inc. http://mysecretbase.com
> ---
> 
> --
> 
>
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: Application vs Request scope

2004-04-22 Thread Matt Robertson
I use request scope.  Declaration is short and simple.  No resource drain noticeable.

Are all shared scope reads safe to no lock now?  I thought it was only session var reads that were completely safe.

Another thing I use a lot of is a cached db query.  I'll have a table with a structure that has a bunch o' fields.  One record per site, typically.  Even the biggest settings tables have no more than 1/2 dozen records, so the query is fast.  Cache it for say 10 seconds and you have the ability to update the db in almost real time while at the same time saving yourself a lot of locks, or req var resets.  If no updates, then cache it for 10 hours or something equally palatable.  YMMV.

--
---
 Matt Robertson, [EMAIL PROTECTED]
 MSB Designs, Inc. http://mysecretbase.com
---

--
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Application vs Request scope

2004-04-22 Thread Chris Alvarado
Hello all,

I've been doing CF development for quite some time and as such im fairly
set on the way I do things. However I just had a debate with another
developer regarding which scope was proper for setting application wide
variable (such as DSN names, file paths etc) in regards to locking /
efficiency etc.

What is everyone's preference and why?

I typically use the application scope with proper locking during
declaration. . . 

Is that the "correct" way or is request scope the preferred method and
why?

Thanks everyone,

-chris.alvarado

[ application developer ]

4 Guys Interactive, Inc.

281.807.4344 x1716
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: CFC from App to Request scope?

2003-10-30 Thread Raymond Camden
You shouldn't need to worry about that.


 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: CFC from App to Request scope?

2003-10-30 Thread Jamie Jackson
Thanks for taking the time to respond. I got all of your points except
for one sentence, so I'll pick it apart:

>However, if you lock the intantiation of the component without
>requiring read locks

You lost me there. Sorry, if it's a couple-liner, would you show me in
code?

>then you can pull all the CFLOCK tags inside the CFC
>(when it manipulates instance data)

Actually, is it only instance data that I have to worry about? As a
matter of fact, none of my methods modifies instance data, they only
read the instance variables.

>so your code isn't littered with CFLOCKs.

My CFC follows, in case it helps.

Thanks again,
Jamie



  
  

  
returntype="helpDef">
	  
// the following querySim has been shortened for this example
request.querySim("
definitionQry
termId, type, term, definition, example
communityResults | component | Community Results | Measureable,
long-term outcomes achieved by individuals, families, and communities.
| 
programResults | component | Program Results | Short-term outcomes
related to unit leadership, informal networks, and program agencies. |
communityCapacity | component | Community Capacity | The extent to
which community members demonstrate a sense of shared responsibility
for their community and a collective competence (i.e., a community's
belief in its capability) to respond to community challenges. | 
");

// cache queries for a long time (30 days)
cacheSpan = createTimeSpan(30,0,0,0);
// alternate nil span for clearing query caches
nilSpan = createTimeSpan(0,0,0,0);
		
    
  
  
  
returntype="query">
    
default="all">
    
    
default="false">
    
    
  
    
    
  SELECT term
  FROM definitionQry
  WHERE 0=0
  
AND termId = '#termId#'
  
  
AND type = '#type#'
  
    
    
  
  
  
returntype="string">
    
    
    
default="false">
    
    
    
  
    
    
cachedwithin="#cacheSpan#">
  SELECT definition
  FROM definitionQry
  WHERE termId = '#termId#'
  
AND type = '#type#'
  
    
    
  
    
  
    
    
  
  
  
returntype="query">
    
default="all">
    
    
default="false">
    
    
  
    
    
  SELECT term, definition
  FROM definitionQry
  WHERE 0=0
  
AND termId = '#termId#'
  
  
AND type = '#type#'
  
  
    
  
  
  
output="true" returntype="string">
    
default="all">
    
default="false">
    
clearCache="#clearCache#")>
    
    
    
  #term# - #definition#
    
    
    
  


 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: CFC from App to Request scope?

2003-10-30 Thread Nathan Strutz
>The reason I tried to duplicate into the request scope: To minimize
>the need for locks on the application-scope reads. (Feel free to
>refute that one, too. :)

Love to...

You don't need to lock variables in CFMX to keep from memory fragmentation
and server crashing. This is done for you by Java. You do need to lock if
there is potential for a race condition, where 2 people could write to the
same variable and cause general application havoc (for instance, 2 people
selecting the same unique record accidentally). If your application scoped
CFC reads and writes variables that can make changes to all users on your
site and can cause race conditions, you should lock, however, do the locking
IN the CFC, around the lines that require the locks, not outside and around
it.

-nathan strutz

 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: CFC from App to Request scope?

2003-10-30 Thread Jamie Jackson
[Whoops, replied to the newsgroup only the first time]

On Thu, 30 Oct 2003 13:38:40 -0600, "Raymond Camden"
<[EMAIL PROTECTED]> wrote:

>Simply put - you can't duplicate a CFC. Why do you need the duplicate?

Okay, that explains that, then. Thanks.

The reason I tried to duplicate into the request scope: To minimize
the need for locks on the application-scope reads. (Feel free to
refute that one, too. :)

Thanks,
Jamie
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: CFC from App to Request scope?

2003-10-30 Thread Bryan F. Hogan
There isn't a need to duplicate() it then.

Request.myCFC=Application.myCFC
  -Original Message-
  From: Jamie Jackson [mailto:[EMAIL PROTECTED]
  Sent: Thursday, October 30, 2003 3:01 PM
  To: CF-Talk
  Subject: Re: CFC from App to Request scope?

  On Thu, 30 Oct 2003 13:38:40 -0600, "Raymond Camden"
  <[EMAIL PROTECTED]> wrote:

  >Simply put - you can't duplicate a CFC. Why do you need the duplicate?

  Okay, that explains that, then. Thanks.

  The reason I tried to duplicate into the request scope: To minimize
  the need for locks on the application-scope reads. (Feel free to
  refute that one, too. :)

  Thanks,
  Jamie


 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: CFC from App to Request scope?

2003-10-30 Thread Jamie Jackson
On Thu, 30 Oct 2003 13:38:40 -0600, "Raymond Camden"
<[EMAIL PROTECTED]> wrote:

>Simply put - you can't duplicate a CFC. Why do you need the duplicate?

Okay, that explains that, then. Thanks.

The reason I tried to duplicate into the request scope: To minimize
the need for locks on the application-scope reads. (Feel free to
refute that one, too. :)

Thanks,
Jamie

 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: CFC from App to Request scope?

2003-10-30 Thread Barney Boisvert
You can't use duplicate on a CFC and get a CFC.  Instead, you get some
bizarre CFC/Struct hybrid.  You have to use the CFC in the application scope
directly, along with the locks.  However, if you lock the intantiation of
the component without requiring read locks, then you can pull all the CFLOCK
tags inside the CFC (when it manipulates instance data), so your code isn't
littered with CFLOCKs.

Basically, the idea of locking the instantiation is to ensure that no
request can get past the instantiation code without having an instance
available to it, and that multiple instances will never be instantiated.
Here's some code to do it:


  


  
    
  
    
  


If you need to instantiate multiple application variables, that'll work too.
You only need to check the existance of one of them (ideally a
single-purpose flag variable), and set them all in the same place as the
component instantiation.
  -Original Message-
  From: Jamie Jackson [mailto:[EMAIL PROTECTED]
  Sent: Thursday, October 30, 2003 11:25 AM
  To: CF-Talk
  Subject: CFC from App to Request scope?

  The following doesn't seem to work: I'm trying to get my object to
  persist, but (I think) I would prefer to access the object via the
  request scope to reduce the number of locks needed. If I call a method
  on request.def, it's missing instance variables (and throwing an
  error, since they're required by the method), whereas with the
  application.def, it works fine.

  
  
  scope="APPLICATION">
    
  
  
    
    
    
  
    
  

  I'm fairly new to CFCs, so any tips, critiques, or debunkings of my
  assumptions are welcome.

  Thanks,
  Jamie

 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: CFC from App to Request scope?

2003-10-30 Thread Raymond Camden
Simply put - you can't duplicate a CFC. Why do you need the duplicate?


 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




CFC from App to Request scope?

2003-10-30 Thread Jamie Jackson
The following doesn't seem to work: I'm trying to get my object to
persist, but (I think) I would prefer to access the object via the
request scope to reduce the number of locks needed. If I call a method
on request.def, it's missing instance variables (and throwing an
error, since they're required by the method), whereas with the
application.def, it works fine.



scope="APPLICATION">
  
    
    
  
  
  
    
  


I'm fairly new to CFCs, so any tips, critiques, or debunkings of my
assumptions are welcome.

Thanks,
Jamie
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Copying session vars to request scope

2003-10-07 Thread Dave Watts
> So is it the duplication of the struct that is causing the performance
> hit?

Yes, that has been my experience.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444

 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: Copying session vars to request scope

2003-10-07 Thread Zac
On Tuesday, October 7, 2003, at 06:02  PM, Dave Watts:

> In my experience, this has occasionally caused severe performance
> degradation, so you'll want to be very careful when doing this. In 
> general,
> I'd try to avoid doing it at all.

Really?  That is quite surprising.

So is it the duplication of the struct that is causing the performance 
hit?

> As others have mentioned, this often isn't necessary with CFMX.

I'm just starting to write some code for MX and this is one of the 
things I am trying to be very careful of

> Finally, you should be very careful when attempting to apply common 
> sense to
> expected performance outcomes.

Or anything associated with application development in general :-)

Thanks to everyone for the links and comments

 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Copying session vars to request scope

2003-10-07 Thread Dave Watts
> Can anyone see any reason why you wouldn't want to copy session 
> scope variables to a request scope variable if all you want to do 
> is to test the values in them but not set them?
>
> It strikes me that this would be more efficient than locking the 
> session scope each time you wanted to test the variables.

In my experience, this has occasionally caused severe performance
degradation, so you'll want to be very careful when doing this. In general,
I'd try to avoid doing it at all.

As others have mentioned, this often isn't necessary with CFMX.

Finally, you should be very careful when attempting to apply common sense to
expected performance outcomes. Very often, things don't behave in an
outwardly sensible manner, so before implementing something like this, it's
a very good idea to do some simple load testing and see what happens in
various cases.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444


 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: Copying session vars to request scope

2003-10-07 Thread Nick Han
From experience, using duplicate() when copying a structure from session to request or a local variable could cause a slight, performance degradation.  Of course, it depends on how big the structure is.  If the structure was big, I would use cflock inline with the assignment code in question, rather than first making a deep copy and then do what I needed to do.

Nick Han

>>> [EMAIL PROTECTED] 10/07/03 01:29PM >>>
Can anyone see any reason why you wouldn't want to copy session scope variables to a request scope variable if all you want to do is to test the values in them but not set them?

It strikes me that this would be more efficient than locking the session scope each time you wanted to test the variables.

But then again I might be missing something really obvious :-)

 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Re: Copying session vars to request scope

2003-10-07 Thread Mike Brunt
We have some information on this in our blog here: -

http://www.webapper.net/index.cfm?fuseaction=Fuseblog.ShowComments&ArticleID=2002125607

Hth

Kind Regards - Mike Brunt

Original Message ---
Zac,

On 10/7/2003 at 16:29, you wrote:

ZB> Can anyone see any reason why you wouldn't want to copy session
ZB> scope variables to a request scope variable if all you want to do
ZB> is to test the values in them but not set them?

ZB> It strikes me that this would be more efficient than locking the
ZB> session scope each time you wanted to test the variables.

If you're on a pre-MX server, I think you're right to go the
duplicate() route. On MX, I've read and heard that locking reads isn't
really necessary due to changes in the way the server handles 'shared
scope' variables:

http://www.macromedia.com/support/coldfusion/ts/documents/tn18235.htm

~ Ubqtous ~


 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Re: Copying session vars to request scope

2003-10-07 Thread Ubqtous
Zac,

On 10/7/2003 at 16:29, you wrote:

ZB> Can anyone see any reason why you wouldn't want to copy session
ZB> scope variables to a request scope variable if all you want to do
ZB> is to test the values in them but not set them?

ZB> It strikes me that this would be more efficient than locking the
ZB> session scope each time you wanted to test the variables.

If you're on a pre-MX server, I think you're right to go the
duplicate() route. On MX, I've read and heard that locking reads isn't
really necessary due to changes in the way the server handles 'shared
scope' variables:

http://www.macromedia.com/support/coldfusion/ts/documents/tn18235.htm

~ Ubqtous ~

 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Copying session vars to request scope

2003-10-07 Thread Zac Belado
Can anyone see any reason why you wouldn't want to copy session scope variables to a request scope variable if all you want to do is to test the values in them but not set them?

It strikes me that this would be more efficient than locking the session scope each time you wanted to test the variables.

But then again I might be missing something really obvious :-)
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Application and Request scope

2003-10-02 Thread Paul Wilson
If I set my site wide DSN in the request scope will this be set every time a template is requested?
 
Should I put the following code in application.cfm
 

 

 
Can you access the Request scope from inside CFC's?
 
 
 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 01 October 2003 06:38
To: CF-Talk
Subject: RE: Application and Request scope


i won a free subscription to it, so price isnt an issue, lol


personally, i think there is so great stuff in there. Sowhere I think you
can do a trial run for free.






> Maybe I'm missing an inside joke. but that site just seems really
> pricey. $2.00 per article or $25.00 per month?  That's more than I pay
> for ColdFusion hosting, my ISP, NetFlix, and all magazines.  Even
> annually (with which you save $100) is 200 bucks a year.
>
> I don't mind paying for content but there seems to be a tremendous
> amount of free, quality content for this stuff.  Is the content really
> that good?
>
> Jim Davis
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, September 30, 2003 9:00 PM
> To: CF-Talk
> Subject: RE: Application and Request scope
>
> good article today on locking at www.communitymx.com
> hint tony, haha! jk
>
>
>
>
>
>
>
>
>
>
>
>> If you're on CFMX locking the Session/Application/Server scopes is not
> a
>> stability issue as it was in 4.5/5.0 - but it is needed to prevent
> race
>> conditions.  However if you're using them in a "read-only" manner (and
>> you're on MX) then locking isn't needed.  In 4.5/5.0 locking is needed
>> to maintain server integrity.
>>
>> For your App information - that's up to you.  I might suggest, at the
>> very least, using the REQUEST scope for them - that way they're
>> available to all custom tags as well.
>>
>> Broadly speaking I generally recommend for users of MX to store this
>> stuff in the Application scope: you can read the information with no
>> locking and it uses less system resources under load.  For CF 4.5/5.0
> I
>>
>
> would say use the Request scope: not having to lock everything is well
>> worth the system resources used by repeating the information for each
>> request.
>>
>> Jim Davis
>>
>> -Original Message-
>> From: cfhelp [mailto:[EMAIL PROTECTED]
>> Sent: Tuesday, September 30, 2003 9:37 AM
>> To: CF-Talk
>> Subject: RE: Application and Request scope
>>
>> I read this and now I am questioning my Application.
>>
>>
>>
>> I have been building a document Library system. The Application is
>> shared
>> between all the sites using it by Virtual Directories.
>>
>>
>>
>> I use session variables in the login.cfm to set the User information
>> (GUID,
>> Directory, IsAdmin) after login authentication.
>>
>>
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>>
>>
>> I am not locking the above.
>>
>>
>>
>>
>>
>> Everything seems to be working when multiple users are on the site (on
>> the
>> same website or sharing). I also named the Application dynamically by
>>
>>
>>
>> 
>>
>> 
>>
>>    sessionmanagement="Yes"
>>
>>    setclientcookies="Yes"
>>
>>    sessiontimeout="#CreateTimeSpan(0,0,30,0)#"
>>
>>    applicationtimeout="#CreateTimeSpan(0,0,30,0)#">
>>
>>
>>
>> Then I just use cfparam to set variables.
>>
>>
>>
>> 
>>
>> 
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




communitymx: was Application and Request scope

2003-09-30 Thread cf
here are some of the articles & tutorials from the coldfusion section,
sure is a lot of the things that go round & round on here


 Exploring the cflock Tag

A look at the cflock tag and it's attributes.

Unicode and International Character Sets in ColdFusion MX: Part 2

Manipulating Images with Jimg (Part 2)
You have not read this article yet

Creating a photo gallery using Jimg, the ColdFusion component from DRK 4.

Page Based Dynamic Images in an Included File: Method 2
You have not read this article yet

Dynamically inserting images into an included file based on the page being
called.

CMX EZ Mail

SB that sends the results of any form to an address of your choosing.

Creating a custom CF log In application

Creating a custom log in application

Manipulating Images with Jimg (Part 1)
You have not read this article yet

How to manipulate images on the server using Jimg, the ColdFusion CFC from
DRK 4.

Upload An Image and Insert Its Name Into The Database

Uploading an image and inserting it's name into the database

Eliminating Extra White Space in Your HTML
You have not read this article yet

Typically, ColdFusion-generated HTML code has plenty of extra white space.
It's easy to get rid of this extra white space. Here's how.

Masks in ColdFusion (Part 2): Formatting Times
You have not read this article yet

How to use ColdFusion's numeric masks.

CMX Email Any Form

Submit any form to a page you apply this server behavior to.

Using Authorize.net with ColdFusionMX

How to use Authorize.net as a payment gateway on your ColdFusion site.

Porting Pollster to SQL Server
You have not read this article yet

How to modify the Pollster application from DRK 4 to run on SQL Server.

Masks in ColdFusion (Part 1): Dates and Times
You have not read this article yet

Using ColdFusion Locales
You have not read this article yet

ColdFusion MX has done a lot to make internationalized applications easier
to build. Aside from it's built-in Unicode support, ColdFusion MX supports
the use of Locales to make it easy to generate the output of dates, times
and other data in a language and culturally-appropriate fashion. This
quick tutorial shows you how to use these locales in your applications.

Unicode and International Character Sets in Coldfusion MX: Part 1
You have not read this article yet

ColdFusion MX is fully Unicode compliant but making everything work
properly for international character sets form the browser through to the
back end database requires a firm understanding of Unicode and how to use
it in ColdFusion MX.

Email a Forgotten Password in ColdFusion

Learn how to email a user's forgotten password to them automatically.

Page Based Dynamic Images in an Included File: Method 1
You have not read this article yet

Dynamically inserting images into an included file based on the page being
called.

High Volume Mail without CFMAIL, Part 3: Handling Bad Addresses and
Bounced Messages
You have not read this article yet

This is the third and final part of a series of articles on using outside
Perl scripts to manage the delivery of mail to large lists from
ColdFusion. This article addresses how to handle incorrectly formed
addresses, banned users and bounced messages.

ColdFusion MX: The Red Sky Upgrade
You have not read this article yet

ColdFusion MX 6.1 updater (code named Red Sky) was released today and
offers much more than simple bug fixes. The release can be considered a
true upgrade. The best part of the upgrade is that it's free.

CMX CF Image Popup

This server behavior will open a popup window containing a picture from
your database, when a particular record is selected on the page.

High Volume Mail without CFMAIL, Part 2: Sending Personalized Messages to
a Mailing List
You have not read this article yet

This is the second in a three-part series showing how you can use Perl to
bypass limitations in CFMAIL for sending mailings to big lists. This
installment shows how to personalize messages sent to the list.

CF Administrator: Debugging Settings
You have not read this article yet

First in a series of articles on the ColdFusion Administrator. This
article will explore the debugging options in the administrator and what
they mean.

High Volume Mail without CFMAIL, Part 1: Sending a Message to a Big List
You have not read this article yet

ColdFusion's CFMAIL is less than adequate for high-volume purposes. This
tutorial shows how to implement your high-volume mail system on Unix-based
ColdFusion servers.

Using a ColdFusion Custom Tag as a Site Template Part 3
You have not read this article yet

ColdFusion custom tags allow you to build a flexible template for your
site that will feed every page on the site. Part 3 will show how to
incorporate a table layout or a div layout in setting up your template.

CMX CF Random Image

This is a Server Behavior for displaying a random image every time your
page is refreshed or revisited.

CF_CMXIMAGE: A Custom tag for image manipulation on the server

This custom ta

RE: Application and Request scope

2003-09-30 Thread cf
i won a free subscription to it, so price isnt an issue, lol


personally, i think there is so great stuff in there. Sowhere I think you
can do a trial run for free.






> Maybe I'm missing an inside joke. but that site just seems really
> pricey. $2.00 per article or $25.00 per month?  That's more than I pay
> for ColdFusion hosting, my ISP, NetFlix, and all magazines.  Even
> annually (with which you save $100) is 200 bucks a year.
>
> I don't mind paying for content but there seems to be a tremendous
> amount of free, quality content for this stuff.  Is the content really
> that good?
>
> Jim Davis
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, September 30, 2003 9:00 PM
> To: CF-Talk
> Subject: RE: Application and Request scope
>
> good article today on locking at www.communitymx.com
> hint tony, haha! jk
>
>
>
>
>
>
>
>
>
>
>
>> If you're on CFMX locking the Session/Application/Server scopes is not
> a
>> stability issue as it was in 4.5/5.0 - but it is needed to prevent
> race
>> conditions.  However if you're using them in a "read-only" manner (and
>> you're on MX) then locking isn't needed.  In 4.5/5.0 locking is needed
>> to maintain server integrity.
>>
>> For your App information - that's up to you.  I might suggest, at the
>> very least, using the REQUEST scope for them - that way they're
>> available to all custom tags as well.
>>
>> Broadly speaking I generally recommend for users of MX to store this
>> stuff in the Application scope: you can read the information with no
>> locking and it uses less system resources under load.  For CF 4.5/5.0
> I
>>
>
> would say use the Request scope: not having to lock everything is well
>> worth the system resources used by repeating the information for each
>> request.
>>
>> Jim Davis
>>
>> -Original Message-
>> From: cfhelp [mailto:[EMAIL PROTECTED]
>> Sent: Tuesday, September 30, 2003 9:37 AM
>> To: CF-Talk
>> Subject: RE: Application and Request scope
>>
>> I read this and now I am questioning my Application.
>>
>>
>>
>> I have been building a document Library system. The Application is
>> shared
>> between all the sites using it by Virtual Directories.
>>
>>
>>
>> I use session variables in the login.cfm to set the User information
>> (GUID,
>> Directory, IsAdmin) after login authentication.
>>
>>
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>>
>>
>> I am not locking the above.
>>
>>
>>
>>
>>
>> Everything seems to be working when multiple users are on the site (on
>> the
>> same website or sharing). I also named the Application dynamically by
>>
>>
>>
>> 
>>
>> 
>>
>>    sessionmanagement="Yes"
>>
>>    setclientcookies="Yes"
>>
>>    sessiontimeout="#CreateTimeSpan(0,0,30,0)#"
>>
>>    applicationtimeout="#CreateTimeSpan(0,0,30,0)#">
>>
>>
>>
>> Then I just use cfparam to set variables.
>>
>>
>>
>> 
>>
>> 
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Application and Request scope

2003-09-30 Thread Peter Tilbrook
Of course but you would only set them once and "read" them and not change
them within the application. At least that is how I use them.

My hosting provider (CFMX updater 3) is flaky at the best of times but this
seems to work for my applications.

If you are in a clustered environment then YES application scope is the one
to use - and lock (within the CFIF ISDEFINED) code.

Remember that APPLICATION variables are scoped according to the immediate
"Application.cfm" file it finds. All the way up to the root directory. If
your "guestbook" application name is shared by another website on the same
host, also called "guestbook" then you could be in trouble. This is where
the application scope is not the scope to use. With the REQUEST scope it is
limited to your own application environment - as long as you at least have
an Application.cfm in your site root to define your request vars.

And NEVER use the SERVER scope in a shared environment without due caution.


 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Application and Request scope

2003-09-30 Thread Jim Davis
Just being a smart ass - but in this case it WILL set them every time
since the Request Scope is non-persistent.
 
Change that "Request" to "Application" and everything you say is
completely correct.  ;^)
 
Jim Davis
 
-Original Message-
From: Peter Tilbrook [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 30, 2003 9:05 PM
To: CF-Talk
Subject: RE: Application and Request scope
 
But remember when setting vars in the Application.cfm file they are
reset on
every request for a .cfm template so test to see if a var exists first
and,
if not, set them all in one go, eg:







etc.

CF will see that Request.ApplicationVersion is or is not already defined
and
setup the vars once only.

Peter Tilbrook
ColdFusion Applications Developer
ColdGen Internet Solutions
Manager, ACT and Region ColdFusion Users Group (http://www.actcfug.com)
4/73 Tharwa Road
Queanbeyan, NSW, 2620
AUSTRALIA

Telephone: +61-2-6284-2727
Mobile: +61-0439-401-823
E-mail: [EMAIL PROTECTED]

World Wide Web: http://www.coldgen.com/

-Original Message-
From: Jim Davis [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 1 October 2003 10:52 AM
To: CF-Talk
Subject: RE: Application and Request scope


If you're on CFMX locking the Session/Application/Server scopes is not a
stability issue as it was in 4.5/5.0 - but it is needed to prevent race
conditions.  However if you're using them in a "read-only" manner (and
you're on MX) then locking isn't needed.  In 4.5/5.0 locking is needed
to maintain server integrity.

For your App information - that's up to you.  I might suggest, at the
very least, using the REQUEST scope for them - that way they're
available to all custom tags as well.

Broadly speaking I generally recommend for users of MX to store this
stuff in the Application scope: you can read the information with no
locking and it uses less system resources under load.  For CF 4.5/5.0 I
would say use the Request scope: not having to lock everything is well
worth the system resources used by repeating the information for each
request.

Jim Davis

-Original Message-
From: cfhelp [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 30, 2003 9:37 AM
To: CF-Talk
Subject: RE: Application and Request scope

I read this and now I am questioning my Application.



I have been building a document Library system. The Application is
shared
between all the sites using it by Virtual Directories.



I use session variables in the login.cfm to set the User information
(GUID,
Directory, IsAdmin) after login authentication.

















I am not locking the above.





Everything seems to be working when multiple users are on the site (on
the
same website or sharing). I also named the Application dynamically by







   sessionmanagement="Yes"

   setclientcookies="Yes"

   sessiontimeout="#CreateTimeSpan(0,0,30,0)#"

   applicationtimeout="#CreateTimeSpan(0,0,30,0)#">



Then I just use cfparam to set variables.






 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Application and Request scope

2003-09-30 Thread Jim Davis
Maybe I'm missing an inside joke. but that site just seems really
pricey. $2.00 per article or $25.00 per month?  That's more than I pay
for ColdFusion hosting, my ISP, NetFlix, and all magazines.  Even
annually (with which you save $100) is 200 bucks a year.
 
I don't mind paying for content but there seems to be a tremendous
amount of free, quality content for this stuff.  Is the content really
that good?
 
Jim Davis
 
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 30, 2003 9:00 PM
To: CF-Talk
Subject: RE: Application and Request scope
 
good article today on locking at www.communitymx.com
hint tony, haha! jk











> If you're on CFMX locking the Session/Application/Server scopes is not
a
> stability issue as it was in 4.5/5.0 - but it is needed to prevent
race
> conditions.  However if you're using them in a "read-only" manner (and
> you're on MX) then locking isn't needed.  In 4.5/5.0 locking is needed
> to maintain server integrity.
>
> For your App information - that's up to you.  I might suggest, at the
> very least, using the REQUEST scope for them - that way they're
> available to all custom tags as well.
>
> Broadly speaking I generally recommend for users of MX to store this
> stuff in the Application scope: you can read the information with no
> locking and it uses less system resources under load.  For CF 4.5/5.0
I
>

would say use the Request scope: not having to lock everything is well
> worth the system resources used by repeating the information for each
> request.
>
> Jim Davis
>
> -Original Message-
> From: cfhelp [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, September 30, 2003 9:37 AM
> To: CF-Talk
> Subject: RE: Application and Request scope
>
> I read this and now I am questioning my Application.
>
>
>
> I have been building a document Library system. The Application is
> shared
> between all the sites using it by Virtual Directories.
>
>
>
> I use session variables in the login.cfm to set the User information
> (GUID,
> Directory, IsAdmin) after login authentication.
>
>
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
>
>
> I am not locking the above.
>
>
>
>
>
> Everything seems to be working when multiple users are on the site (on
> the
> same website or sharing). I also named the Application dynamically by
>
>
>
> 
>
> 
>
>    sessionmanagement="Yes"
>
>    setclientcookies="Yes"
>
>    sessiontimeout="#CreateTimeSpan(0,0,30,0)#"
>
>    applicationtimeout="#CreateTimeSpan(0,0,30,0)#">
>
>
>
> Then I just use cfparam to set variables.
>
>
>
> 
>
> 
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Application and Request scope

2003-09-30 Thread Tony Weeg
i hear ya ;)

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 30, 2003 9:00 PM
To: CF-Talk
Subject: RE: Application and Request scope


good article today on locking at www.communitymx.com
hint tony, haha! jk











> If you're on CFMX locking the Session/Application/Server scopes is not
a
> stability issue as it was in 4.5/5.0 - but it is needed to prevent
race
> conditions.  However if you're using them in a "read-only" manner (and
> you're on MX) then locking isn't needed.  In 4.5/5.0 locking is needed
> to maintain server integrity.
>
> For your App information - that's up to you.  I might suggest, at the
> very least, using the REQUEST scope for them - that way they're
> available to all custom tags as well.
>
> Broadly speaking I generally recommend for users of MX to store this
> stuff in the Application scope: you can read the information with no
> locking and it uses less system resources under load.  For CF 4.5/5.0
I
>

would say use the Request scope: not having to lock everything is well
> worth the system resources used by repeating the information for each
> request.
>
> Jim Davis
>
> -Original Message-
> From: cfhelp [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, September 30, 2003 9:37 AM
> To: CF-Talk
> Subject: RE: Application and Request scope
>
> I read this and now I am questioning my Application.
>
>
>
> I have been building a document Library system. The Application is
> shared
> between all the sites using it by Virtual Directories.
>
>
>
> I use session variables in the login.cfm to set the User information
> (GUID,
> Directory, IsAdmin) after login authentication.
>
>
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
>
>
> I am not locking the above.
>
>
>
>
>
> Everything seems to be working when multiple users are on the site (on
> the
> same website or sharing). I also named the Application dynamically by
>
>
>
> 
>
> 
>
>    sessionmanagement="Yes"
>
>    setclientcookies="Yes"
>
>    sessiontimeout="#CreateTimeSpan(0,0,30,0)#"
>
>    applicationtimeout="#CreateTimeSpan(0,0,30,0)#">
>
>
>
> Then I just use cfparam to set variables.
>
>
>
> 
>
> 
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Application and Request scope

2003-09-30 Thread Peter Tilbrook
But remember when setting vars in the Application.cfm file they are reset on
every request for a .cfm template so test to see if a var exists first and,
if not, set them all in one go, eg:


	
	
	


etc.

CF will see that Request.ApplicationVersion is or is not already defined and
setup the vars once only.

Peter Tilbrook
ColdFusion Applications Developer
ColdGen Internet Solutions
Manager, ACT and Region ColdFusion Users Group (http://www.actcfug.com)
4/73 Tharwa Road
Queanbeyan, NSW, 2620
AUSTRALIA

Telephone: +61-2-6284-2727
Mobile: +61-0439-401-823
E-mail: [EMAIL PROTECTED]

World Wide Web: http://www.coldgen.com/

-Original Message-
From: Jim Davis [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 1 October 2003 10:52 AM
To: CF-Talk
Subject: RE: Application and Request scope


If you're on CFMX locking the Session/Application/Server scopes is not a
stability issue as it was in 4.5/5.0 - but it is needed to prevent race
conditions.  However if you're using them in a "read-only" manner (and
you're on MX) then locking isn't needed.  In 4.5/5.0 locking is needed
to maintain server integrity.

For your App information - that's up to you.  I might suggest, at the
very least, using the REQUEST scope for them - that way they're
available to all custom tags as well.

Broadly speaking I generally recommend for users of MX to store this
stuff in the Application scope: you can read the information with no
locking and it uses less system resources under load.  For CF 4.5/5.0 I
would say use the Request scope: not having to lock everything is well
worth the system resources used by repeating the information for each
request.

Jim Davis

-Original Message-
From: cfhelp [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 30, 2003 9:37 AM
To: CF-Talk
Subject: RE: Application and Request scope

I read this and now I am questioning my Application.



I have been building a document Library system. The Application is
shared
between all the sites using it by Virtual Directories.



I use session variables in the login.cfm to set the User information
(GUID,
Directory, IsAdmin) after login authentication.

















I am not locking the above.





Everything seems to be working when multiple users are on the site (on
the
same website or sharing). I also named the Application dynamically by







   sessionmanagement="Yes"

   setclientcookies="Yes"

   sessiontimeout="#CreateTimeSpan(0,0,30,0)#"

   applicationtimeout="#CreateTimeSpan(0,0,30,0)#">



Then I just use cfparam to set variables.






 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Application and Request scope

2003-09-30 Thread cf
good article today on locking at www.communitymx.com
hint tony, haha! jk











> If you're on CFMX locking the Session/Application/Server scopes is not a
> stability issue as it was in 4.5/5.0 - but it is needed to prevent race
> conditions.  However if you're using them in a "read-only" manner (and
> you're on MX) then locking isn't needed.  In 4.5/5.0 locking is needed
> to maintain server integrity.
>
> For your App information - that's up to you.  I might suggest, at the
> very least, using the REQUEST scope for them - that way they're
> available to all custom tags as well.
>
> Broadly speaking I generally recommend for users of MX to store this
> stuff in the Application scope: you can read the information with no
> locking and it uses less system resources under load.  For CF 4.5/5.0 I
>

would say use the Request scope: not having to lock everything is well
> worth the system resources used by repeating the information for each
> request.
>
> Jim Davis
>
> -Original Message-
> From: cfhelp [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, September 30, 2003 9:37 AM
> To: CF-Talk
> Subject: RE: Application and Request scope
>
> I read this and now I am questioning my Application.
>
>
>
> I have been building a document Library system. The Application is
> shared
> between all the sites using it by Virtual Directories.
>
>
>
> I use session variables in the login.cfm to set the User information
> (GUID,
> Directory, IsAdmin) after login authentication.
>
>
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
>
>
> I am not locking the above.
>
>
>
>
>
> Everything seems to be working when multiple users are on the site (on
> the
> same website or sharing). I also named the Application dynamically by
>
>
>
> 
>
> 
>
>    sessionmanagement="Yes"
>
>    setclientcookies="Yes"
>
>    sessiontimeout="#CreateTimeSpan(0,0,30,0)#"
>
>    applicationtimeout="#CreateTimeSpan(0,0,30,0)#">
>
>
>
> Then I just use cfparam to set variables.
>
>
>
> 
>
> 
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Application and Request scope

2003-09-30 Thread Jim Davis
If you're on CFMX locking the Session/Application/Server scopes is not a
stability issue as it was in 4.5/5.0 - but it is needed to prevent race
conditions.  However if you're using them in a "read-only" manner (and
you're on MX) then locking isn't needed.  In 4.5/5.0 locking is needed
to maintain server integrity.
 
For your App information - that's up to you.  I might suggest, at the
very least, using the REQUEST scope for them - that way they're
available to all custom tags as well.
 
Broadly speaking I generally recommend for users of MX to store this
stuff in the Application scope: you can read the information with no
locking and it uses less system resources under load.  For CF 4.5/5.0 I
would say use the Request scope: not having to lock everything is well
worth the system resources used by repeating the information for each
request.
 
Jim Davis
 
-Original Message-
From: cfhelp [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 30, 2003 9:37 AM
To: CF-Talk
Subject: RE: Application and Request scope
 
I read this and now I am questioning my Application.



I have been building a document Library system. The Application is
shared
between all the sites using it by Virtual Directories. 



I use session variables in the login.cfm to set the User information
(GUID,
Directory, IsAdmin) after login authentication.

















I am not locking the above.





Everything seems to be working when multiple users are on the site (on
the
same website or sharing). I also named the Application dynamically by







   sessionmanagement="Yes"

   setclientcookies="Yes"

   sessiontimeout="#CreateTimeSpan(0,0,30,0)#"

   applicationtimeout="#CreateTimeSpan(0,0,30,0)#">



Then I just use cfparam to set variables.






 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Application and Request scope

2003-09-30 Thread Mike Brunt
Rick, you should lock Application, Server and Session variables.  Session
because if you use Frames or if you have slow running requests users can
launch more than one thread which can cause memory corruption.

Here is how those three scopes are seen: -

SERVER – By all CFAPPLICATIONs on a single physical server.

APPLICATION – By all users in a single CFAPPLICATION

SESSION – By a single user in a single Session.

I have another suggestion go to our blog at http://www.webapper.net
<http://www.webapper.net/>  and search for CFLOCK you will find a few
pointers there that may help.

Kind Regards - Mike Brunt
Webapper Services LLC
Web Site http://www.webapper.com
Blog http://www.webapper.net

Webapper 

-Original Message-
From: cfhelp [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 30, 2003 6:37 AM
To: CF-Talk
Subject: RE: Application and Request scope

I read this and now I am questioning my Application.



I have been building a document Library system. The Application is shared
between all the sites using it by Virtual Directories.



I use session variables in the login.cfm to set the User information (GUID,
Directory, IsAdmin) after login authentication.

















I am not locking the above.





Everything seems to be working when multiple users are on the site (on the
same website or sharing). I also named the Application dynamically by







   sessionmanagement="Yes"

   setclientcookies="Yes"

   sessiontimeout="#CreateTimeSpan(0,0,30,0)#"

   applicationtimeout="#CreateTimeSpan(0,0,30,0)#">



Then I just use cfparam to set variables.






 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Application and Request scope

2003-09-30 Thread cfhelp
I read this and now I am questioning my Application.

 

I have been building a document Library system. The Application is shared
between all the sites using it by Virtual Directories. 

 

I use session variables in the login.cfm to set the User information (GUID,
Directory, IsAdmin) after login authentication.

 













 

I am not locking the above.

 

 

Everything seems to be working when multiple users are on the site (on the
same website or sharing). I also named the Application dynamically by

 





   sessionmanagement="Yes"

   setclientcookies="Yes"

   sessiontimeout="#CreateTimeSpan(0,0,30,0)#"

   applicationtimeout="#CreateTimeSpan(0,0,30,0)#">

 

Then I just use cfparam to set variables.

 




 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: Application and Request scope

2003-09-30 Thread Jim Davis
I explain this pretty thoroughly in my guide to CF variables here:
 
http://www.depressedpress.com/DepressedPress/Content/ColdFusion/Guides/V
ariables/Index.cfm
 
I'm sure other people have other (perhaps better) opinions but that
should give you the skinny at least.
 
Jim Davis
 
-Original Message-
From: Paul Wilson [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 30, 2003 8:08 AM
To: CF-Talk
Subject: Application and Request scope
 
I've been reading a few threads that advise on storing various things
(that's a technical description btw) in the
application or request scope. Why is this a good idea and what things
should be stored there?

Thanks!
  _  

[Todays 
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




Application and Request scope

2003-09-30 Thread Paul Wilson
I've been reading a few threads that advise on storing various things (that's a technical description btw) in the
application or request scope. Why is this a good idea and what things should be stored there?

Thanks!
 [Todays Threads] 
 [This Message] 
 [Subscription] 
 [Fast Unsubscribe] 
 [User Settings]




RE: session vs. request scope speed in MX

2003-02-06 Thread Ben Doom
Nevermind.  Christian just managed to answer it in another thread.  :-)

How is it that every time I post here, the answer magically pops up and my
thread becomes moot?

I think the list is out to get me.  Yeah, that's it.


--  Ben Doom
Programmer & General Lackey
Moonbow Software, Inc

: -Original Message-
: From: Ben Doom [mailto:[EMAIL PROTECTED]]
: Sent: Thursday, February 06, 2003 11:05 AM
: To: CF-Talk
: Subject: session vs. request scope speed in MX
:
:
: I understand that in CF5 there's a decent speed difference between using
: locked session variables and request variables.  Now that CF takes care of
: locking of session variables, is there still enough performance difference
: to warrant copying the session variables to the request scope if I'm going
: to be reading/writing them a lot, or should I just stop worrying about it?
:
:
: --  Ben Doom
: Programmer & General Lackey
: Moonbow Software, Inc
:
:
: 
~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4




session vs. request scope speed in MX

2003-02-06 Thread Ben Doom
I understand that in CF5 there's a decent speed difference between using
locked session variables and request variables.  Now that CF takes care of
locking of session variables, is there still enough performance difference
to warrant copying the session variables to the request scope if I'm going
to be reading/writing them a lot, or should I just stop worrying about it?


--  Ben Doom
Programmer & General Lackey
Moonbow Software, Inc


~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4




RE: Opinion: CFC / Request scope question.

2002-06-07 Thread todd

Which is what I do, but why would this be anti-OOP?  Are you sayiing to 
follow the true OOP standards, that in each CFC, I have to make a 
 / or just  initialize those external objects I want to use?

~Todd

O Fri, 7 Jun 2002, Raymond Camden wrote:

> I don't think that is what he is asking Ben. He is not talking about
> making the CFC depend on request vars, rather, he is talking about
> putting an instance of a CFC in the request scope. So he can do crap
> like this:
> 
> application.cfm:
> 
> 
> foo.cfm:
> 
> sometag.cfm:
> 
> stuff;
> stuff;
> more stuff;
> request.logger.log("info","Added user bob");
> 
> 
> 
> 
> ===
> Raymond Camden, ColdFusion Jedi Master for Macromedia
> 
> Email: [EMAIL PROTECTED]
> Yahoo IM : morpheus
> 
> "My ally is the Force, and a powerful ally it is." - Yoda 
> 
> > -Original Message-
> > From: Ben Johnson [mailto:[EMAIL PROTECTED]] 
> > Sent: Friday, June 07, 2002 10:44 AM
> > To: CF-Talk
> > Subject: RE: Opinion: CFC / Request scope question.
> > 
> > 
> > > However, I'd still like to know peoples
> > > thoughts on pushing a component into the request scope.
> > 
> > I have not worked *too* much with CFCs, with the exception of 
> > with Flash
> > Remoting, but the idea of putting the CFCs in the request 
> > scope seems to be
> > a bit anti-OO to me.  I have always thought that you should 
> > pass references
> > or values to the CFC you are calling.  It doesn't seem very 
> > scalable to make
> > a CFC assume something is already created in the request 
> > scope or even that
> > the variable that is created is specifically named a certain way.
> > 
> > 
> > 
> > Ben Johnson
> > Hostworks, Inc.
> > 
> > 
> 
__
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Opinion: CFC / Request scope question.

2002-06-07 Thread Raymond Camden

Ah, now THAT is a different matter. In general, I agree, it's a bad
idea. However, if you are building a framework where a set of CFCs work
together (in a package perhaps) then it may be safe. Spectra made heavy
use of stuff like this - and I think it made sense since everything was
so tightly wound together.

Another view on this - most of the custom tags I write that do DB stuff
will use #application.dsn# or #request.app.dsn# for the datasource.
Since the custom tag is _for_ the application, I don't feel bad about
this at all.

===
Raymond Camden, ColdFusion Jedi Master for Macromedia

Email: [EMAIL PROTECTED]
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

> -Original Message-
> From: Ben Johnson [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, June 07, 2002 11:01 AM
> To: CF-Talk
> Subject: RE: Opinion: CFC / Request scope question.
> 
> 
> > I don't think that is what he is asking Ben. He is not talking about
> > making the CFC depend on request vars, rather, he is talking about
> > putting an instance of a CFC in the request scope.
> 
> Sorry, I quoted the wrong section.  I can definitely 
> understand using CFCs
> in the request scope for that reason.  Here's what I mean to quote:
> 
> 
> [EMAIL PROTECTED]:
> > Now .. 'request.x' is available to even other cfcs without 
> having to make
> > an additional invoke/createObject call.
> 
> 
> 
> 
> Ben Johnson
> Hostworks, Inc.
> 
> 
__
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Opinion: CFC / Request scope question.

2002-06-07 Thread Ben Johnson

> I don't think that is what he is asking Ben. He is not talking about
> making the CFC depend on request vars, rather, he is talking about
> putting an instance of a CFC in the request scope.

Sorry, I quoted the wrong section.  I can definitely understand using CFCs
in the request scope for that reason.  Here's what I mean to quote:


[EMAIL PROTECTED]:
> Now .. 'request.x' is available to even other cfcs without having to make
> an additional invoke/createObject call.




Ben Johnson
Hostworks, Inc.

__
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Opinion: CFC / Request scope question.

2002-06-07 Thread Raymond Camden

I don't think that is what he is asking Ben. He is not talking about
making the CFC depend on request vars, rather, he is talking about
putting an instance of a CFC in the request scope. So he can do crap
like this:

application.cfm:


foo.cfm:

sometag.cfm:

stuff;
stuff;
more stuff;
request.logger.log("info","Added user bob");




===
Raymond Camden, ColdFusion Jedi Master for Macromedia

Email: [EMAIL PROTECTED]
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

> -Original Message-
> From: Ben Johnson [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, June 07, 2002 10:44 AM
> To: CF-Talk
> Subject: RE: Opinion: CFC / Request scope question.
> 
> 
> > However, I'd still like to know peoples
> > thoughts on pushing a component into the request scope.
> 
> I have not worked *too* much with CFCs, with the exception of 
> with Flash
> Remoting, but the idea of putting the CFCs in the request 
> scope seems to be
> a bit anti-OO to me.  I have always thought that you should 
> pass references
> or values to the CFC you are calling.  It doesn't seem very 
> scalable to make
> a CFC assume something is already created in the request 
> scope or even that
> the variable that is created is specifically named a certain way.
> 
> 
> 
> Ben Johnson
> Hostworks, Inc.
> 
> 
__
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Opinion: CFC / Request scope question.

2002-06-07 Thread Ben Johnson

> However, I'd still like to know peoples
> thoughts on pushing a component into the request scope.

I have not worked *too* much with CFCs, with the exception of with Flash
Remoting, but the idea of putting the CFCs in the request scope seems to be
a bit anti-OO to me.  I have always thought that you should pass references
or values to the CFC you are calling.  It doesn't seem very scalable to make
a CFC assume something is already created in the request scope or even that
the variable that is created is specifically named a certain way.



Ben Johnson
Hostworks, Inc.

__
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Opinion: CFC / Request scope question.

2002-06-07 Thread todd

I'm asking about pushing it into the request scope more than anything. 
 Just checking to see if people cringe at the thought or not. =)

Thanks,
~Todd

On Fri, 7 Jun 2002, Raymond Camden wrote:

> Are you asking about pushing it into the request scope or putting it
> into a variable in general? I don' think there is anything wrong with
> either. Certainly if you want your custom tags to use the CFC it makes
> since to put it in the request scope.
> 
> ===
> Raymond Camden, ColdFusion Jedi Master for Macromedia
> 
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
> > Sent: Friday, June 07, 2002 10:19 AM
> > To: CF-Talk
> > Subject: RE: Opinion: CFC / Request scope question.
> > 
> > 
> > I actually use #2 a lot (cept, I wrap script around all that)... 
> > I find it easier to work with.  However, I'd still like to 
> > know peoples 
> > thoughts on pushing a component into the request scope.
> > 
> > Just to clarify:
> > 
> > x = createObject("component","test");
> > request.x = x;
> > 
> > 
> > Now .. 'request.x' is available to even other cfcs without 
> > having to make 
> > an additional invoke/createObject call.
> > 
> > ~Todd

__
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Opinion: CFC / Request scope question.

2002-06-07 Thread Raymond Camden

Are you asking about pushing it into the request scope or putting it
into a variable in general? I don' think there is anything wrong with
either. Certainly if you want your custom tags to use the CFC it makes
since to put it in the request scope.

===
Raymond Camden, ColdFusion Jedi Master for Macromedia

Email: [EMAIL PROTECTED]
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, June 07, 2002 10:19 AM
> To: CF-Talk
> Subject: RE: Opinion: CFC / Request scope question.
> 
> 
> I actually use #2 a lot (cept, I wrap script around all that)... 
> I find it easier to work with.  However, I'd still like to 
> know peoples 
> thoughts on pushing a component into the request scope.
> 
> Just to clarify:
> 
> x = createObject("component","test");
> request.x = x;
> 
> 
> Now .. 'request.x' is available to even other cfcs without 
> having to make 
> an additional invoke/createObject call.
> 
> ~Todd
> 
> On Fri, 7 Jun 2002, Raymond Camden wrote:
> 
> > I think the question can be made a bit more broad - what is better:
> > 
> > 1) 
> > 
> > or
> > 
> > 2) 
> > 
> > 
> > In general my feelings are that if you are going to do anything more
> > than call one method, you should use #2. It should be 
> quicker (since you
> > have the object already), but more than that, it's handier 
> to have the
> > object around I would think.
> > 
> > Of course, since CFCs have been out for just a little while 
> now, what I
> 

__
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Opinion: CFC / Request scope question.

2002-06-07 Thread todd

I actually use #2 a lot (cept, I wrap script around all that)... 
I find it easier to work with.  However, I'd still like to know peoples 
thoughts on pushing a component into the request scope.

Just to clarify:

x = createObject("component","test");
request.x = x;


Now .. 'request.x' is available to even other cfcs without having to make 
an additional invoke/createObject call.

~Todd

On Fri, 7 Jun 2002, Raymond Camden wrote:

> I think the question can be made a bit more broad - what is better:
> 
> 1) 
> 
> or
> 
> 2) 
>   
> 
> In general my feelings are that if you are going to do anything more
> than call one method, you should use #2. It should be quicker (since you
> have the object already), but more than that, it's handier to have the
> object around I would think.
> 
> Of course, since CFCs have been out for just a little while now, what I
> think makes sense now will probably change by next Tuesday. ;)
> 
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
> > Sent: Friday, June 07, 2002 10:08 AM
> > Subject: Opinion: CFC / Request scope question.
> > 
> > So, I'm pretty familiar with CFCs and getting it to work, 
> > etc.  I learned 
> > that you can actually store a function within the variable 
> > scope (in fact, 
> > I learned that when you create a UDF, it's actually placed in 
> > the variable 
> > scope).  I also recently learned that you can push a component of an 
> > object inside a variable as well (via CreateObject();).
> > 
> > I created a 'logging' component that all it does is takes an argument 
> > (event_id) and it checks the db if it should log the event 
> > and / or notify 
> > someone of the event. I pushed this logging component into 
> > the request 
> > scope and it's now available to all my applications (even other CFCs).
> > 
> > I guess my question is, is this a bad thing to do?  What's 
> > the impact of 
> > pushing components into the request scope (besides 
> > memory)...?  I know 
> > there's this holy war going on regarding the 'request' scope as some 
> > people say it shouldn't be touched and other people claim 
> > that's what it's 
> > for.
> > 
> > Just looking for opinions...
> > 
> > Thanks,
> > ~Todd
> > 

__
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Opinion: CFC / Request scope question.

2002-06-07 Thread Neil Clark - =TMM=

That long? :-p











Neil Clark
Team Macromedia
http://www.macromedia.com/go/team

Announcing Macromedia MX!! 
http://www.macromedia.com/software/trial/




-Original Message-
From: Raymond Camden [mailto:[EMAIL PROTECTED]] 
Sent: 07 June 2002 15:16
To: CF-Talk
Subject: RE: Opinion: CFC / Request scope question.

I think the question can be made a bit more broad - what is better:

1) 

or

2) 


In general my feelings are that if you are going to do anything more
than call one method, you should use #2. It should be quicker (since you
have the object already), but more than that, it's handier to have the
object around I would think.

Of course, since CFCs have been out for just a little while now, what I
think makes sense now will probably change by next Tuesday. ;)

===
Raymond Camden, ColdFusion Jedi Master for Macromedia

Email: [EMAIL PROTECTED]
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, June 07, 2002 10:08 AM
> To: CF-Talk
> Subject: Opinion: CFC / Request scope question.
> 
> 
> So, I'm pretty familiar with CFCs and getting it to work, 
> etc.  I learned 
> that you can actually store a function within the variable 
> scope (in fact, 
> I learned that when you create a UDF, it's actually placed in 
> the variable 
> scope).  I also recently learned that you can push a component of an 
> object inside a variable as well (via CreateObject();).
> 
> I created a 'logging' component that all it does is takes an argument 
> (event_id) and it checks the db if it should log the event 
> and / or notify 
> someone of the event. I pushed this logging component into 
> the request 
> scope and it's now available to all my applications (even other CFCs).
> 
> I guess my question is, is this a bad thing to do?  What's 
> the impact of 
> pushing components into the request scope (besides 
> memory)...?  I know 
> there's this holy war going on regarding the 'request' scope as some 
> people say it shouldn't be touched and other people claim 
> that's what it's 
> for.
> 
> Just looking for opinions...
> 
> Thanks,
> ~Todd
> 
> -- 
> 
> Todd Rafferty ([EMAIL PROTECTED]) - http://www.web-rat.com/ |
> http://www.flashCFM.com/   - webRat (Moderator)|
> http://www.ultrashock.com/ - webRat (Back-end Moderator)   |
> 
> 
> 

__
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Opinion: CFC / Request scope question.

2002-06-07 Thread Raymond Camden

I think the question can be made a bit more broad - what is better:

1) 

or

2) 


In general my feelings are that if you are going to do anything more
than call one method, you should use #2. It should be quicker (since you
have the object already), but more than that, it's handier to have the
object around I would think.

Of course, since CFCs have been out for just a little while now, what I
think makes sense now will probably change by next Tuesday. ;)

===
Raymond Camden, ColdFusion Jedi Master for Macromedia

Email: [EMAIL PROTECTED]
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, June 07, 2002 10:08 AM
> To: CF-Talk
> Subject: Opinion: CFC / Request scope question.
> 
> 
> So, I'm pretty familiar with CFCs and getting it to work, 
> etc.  I learned 
> that you can actually store a function within the variable 
> scope (in fact, 
> I learned that when you create a UDF, it's actually placed in 
> the variable 
> scope).  I also recently learned that you can push a component of an 
> object inside a variable as well (via CreateObject();).
> 
> I created a 'logging' component that all it does is takes an argument 
> (event_id) and it checks the db if it should log the event 
> and / or notify 
> someone of the event. I pushed this logging component into 
> the request 
> scope and it's now available to all my applications (even other CFCs).
> 
> I guess my question is, is this a bad thing to do?  What's 
> the impact of 
> pushing components into the request scope (besides 
> memory)...?  I know 
> there's this holy war going on regarding the 'request' scope as some 
> people say it shouldn't be touched and other people claim 
> that's what it's 
> for.
> 
> Just looking for opinions...
> 
> Thanks,
> ~Todd
> 
> -- 
> 
> Todd Rafferty ([EMAIL PROTECTED]) - http://www.web-rat.com/ |
> http://www.flashCFM.com/   - webRat (Moderator)|
> http://www.ultrashock.com/ - webRat (Back-end Moderator)   |
> 
> 
> 
__
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Opinion: CFC / Request scope question.

2002-06-07 Thread todd

So, I'm pretty familiar with CFCs and getting it to work, etc.  I learned 
that you can actually store a function within the variable scope (in fact, 
I learned that when you create a UDF, it's actually placed in the variable 
scope).  I also recently learned that you can push a component of an 
object inside a variable as well (via CreateObject();).

I created a 'logging' component that all it does is takes an argument 
(event_id) and it checks the db if it should log the event and / or notify 
someone of the event. I pushed this logging component into the request 
scope and it's now available to all my applications (even other CFCs).

I guess my question is, is this a bad thing to do?  What's the impact of 
pushing components into the request scope (besides memory)...?  I know 
there's this holy war going on regarding the 'request' scope as some 
people say it shouldn't be touched and other people claim that's what it's 
for.

Just looking for opinions...

Thanks,
~Todd

-- 

Todd Rafferty ([EMAIL PROTECTED]) - http://www.web-rat.com/ |
http://www.flashCFM.com/   - webRat (Moderator)|
http://www.ultrashock.com/ - webRat (Back-end Moderator)   |


__
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



  1   2   3   >