REQUEST scope
I know we've had a trillion questions about variable scopes, but I have one more: Please correct me on any of the following: The REQUEST scope: 1. Doesn't need to be locked. 2. Is stored in server memory. 3. Is only generated once per application (as opposed to once per client session). 4. Is available to all templates (custom tags, includes, base, etc.) 5. Should be primarily used for "constants". Is there a negative to using it? Thanks, Evan ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Request Scope
The "Request" scope was available in CF 4.0 wasn't it? ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Request Scope
Is the requesy scope the scope that is used when say I set something in the document so if I wanted to refer to that in the document I would use #request.here# or is this a different scope? Robert Everland III Web Developer Dixon Ticonderoga ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
request scope.
Anyone know for sure how long the request scope has been a part of CF? What version in partic did it debut? __ Get Your Own Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb 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
Request Scope.
Hi all, Can any of you explain to me why the request scope is useful, if indeed, it is? It is one of the few scopes I am unfamiliar with. Can it be used to enhance my code? Regards, Martin. __ Why Share? Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc 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
Request scope variables
The ColdFusion Locking Best Practices article http://www.allaire.com/handlers/index.cfm?ID=17318&Method=Full&Title=ColdFus ion%20Locking%20Best%20Practices&Cache=False talks about using the request scope when you want to use application variables for DSN names Can anyone explain what request scope variables are and when to use them? A little sample code would be really helpful :-) CF Studio help has a paragraph on the page "Passing Attribute Values between Custom Tags", but it didn't help much and a search on allaire.com didn't produce anything valuable. Thanks in advance -- Aidan Whitehall <[EMAIL PROTECTED]> Netshopper UK Ltd Advanced Web Solutions & Services http://www.netshopperuk.com/ Telephone +44 (01744) 648650 Fax +44 (01744) 648651 -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Mysterious Request Scope
I have seen a few references to the REQUEST scope by many on this list. Is this a standard scope that is available to all CF pages? What is stored in this structure? Is there any information on it in the CF documentation? When does it get built? Mark Johnson --- Senior Cold Fusion Developer Cardinal Communications Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED]
Request Scope Questions
I've been trying to brush up on my CF skills and I'm a bit confused with Request Variables. I've been through Ben Forta's CF5 Construction Kit and Danesh CF4 books and I only see reference to Request Variables in discussions of Custom Tags as a variable type that can be shared and changed by both the custom tag and the calling template. That makes sense to me, if I understand it correctly. But I have also seen the Request Scope mentioned on this list and in sample code in other contexts. Some defining Application variables such as datasource name and User Access data. So I guess my question are: 1. What exacty is the Request Scope? 2. How are Request Variables similar or different from Session or Application Variables? 3. When should/shouldn't Request Variables be used? 4. What about locking? I've read that Request Variables don't need to be locked. Is that true? Why not? TIA Terry ~~ 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: REQUEST scope
Request variables are created and recreated for each individual HTTP request. REQUEST scoped variables do not persist beyond a single request, though all tags, nested tags, and included files can access it. I believe everything else you said looked correct to me. ~Simon > Simon Horwith > Certified ColdFusion Developer > Fig Leaf Software > 1400 16th St NW, # 220 > Washington DC 20036 > 202.797.6570 (direct line) > www.figleaf.com > -Original Message- From: Evan Lavidor [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 12, 2000 5:37 PM To: CF-Talk Subject: REQUEST scope I know we've had a trillion questions about variable scopes, but I have one more: Please correct me on any of the following: The REQUEST scope: 1. Doesn't need to be locked. 2. Is stored in server memory. 3. Is only generated once per application (as opposed to once per client session). 4. Is available to all templates (custom tags, includes, base, etc.) 5. Should be primarily used for "constants". Is there a negative to using it? Thanks, Evan ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: REQUEST scope
> Please correct me on any of the following: > > The REQUEST scope: > > 1. Doesn't need to be locked. True. > 2. Is stored in server memory. This is true, but not in the way you most likely mean. Most variables are stored in memory at some point. Request variables are not stored persistently in memory, though, as are Session, Application and Server variables. They're only available for the duration of the response to a single page request (thus the name of the scope). > 3. Is only generated once per application (as opposed to once > per client session). If you use them in Application.cfm, which is how you'd typically use them for constants, they'd be generated for each page request within that application. > 4. Is available to all templates (custom tags, includes, base, etc.) True. This is the only thing that differentiates the Request scope from the local Variables scope. > 5. Should be primarily used for "constants". I would argue that constants should be placed within the Request scope, but it can come in handy for other things as well. > Is there a negative to using it? Of course there is. Nothing is free in programming, or anywhere else. Each alternative has advantages and disadvantages. The advantage of using the Request scope for constants is that you don't have to worry about locking. The disadvantage is that those variables will be created and destroyed for each page request. It's up to you to evaluate whether the advantages outweigh the disadvantages for any particular use. For most variables that are used similarly to constants, the Request scope makes sense, in my opinion. If you wanted to make a recordset available on each page, though, the Request scope wouldn't be a very good idea at all. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: REQUEST scope
The Maryland CFUG has a chart on their website that answers your questions and many more: http://www.cfug-md.org/articles/scope_STORAGE_analysis.PDF Enjoy! Bill >>> "Evan Lavidor" <[EMAIL PROTECTED]> 12/12/00 3:37 PM >>> I know we've had a trillion questions about variable scopes, but I have one more: Please correct me on any of the following: The REQUEST scope: 1. Doesn't need to be locked. 2. Is stored in server memory. 3. Is only generated once per application (as opposed to once per client session). 4. Is available to all templates (custom tags, includes, base, etc.) 5. Should be primarily used for "constants". Is there a negative to using it? Thanks, Evan ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: REQUEST scope
> > 5. Should be primarily used for "constants". > > I would argue that constants should be placed within the Request scope, but > it can come in handy for other things as well. What happens within a custom cfml tag if the tag inadvertantly refers to or redefines a variable defined in the request scope? For example, say, in application.cfm Then, within a cfml tag, you have: Will the cfml tag have overwritten the request scope variable? Jim ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: REQUEST scope
At 06:02 PM 12/12/00 , you wrote: >What happens within a custom cfml tag if the tag inadvertantly refers to or >redefines a variable defined in the request scope? For example, say, in >application.cfm > > > > >Then, within a cfml tag, you have: > > i believe this creates a LOCAL variable, and the request.variable would still be available. So, if you were to issue the command: before the line: you would get a cferror, if you want to access the request.datasource, you'd have to specify it. ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
request scope revisted
Anyone out there set a request.dsn instead of an application.dsn? If so is there an advantage? Won ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
request scope confusion
I am trying to understand the request scope. What is the difference between putting vs. cfset request.DSN = 'foo'> in the application.cfm template or in any template? Thanks, Sebastian ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Request Scope
> The "Request" scope was available in CF 4.0 wasn't it? It was either introduced in 4.0 or 4.0.1; I think it was 4.0. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Request Scope
I think it was only available from 4.0.1. - Original Message - From: "Joseph Thompson" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Thursday, February 01, 2001 1:25 PM Subject: Request Scope > The "Request" scope was available in CF 4.0 wasn't it? > > > ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Request Scope
> The "Request" scope was available in CF 4.0 wasn't it? Yup, just tested on our 4.0.1 server and it worked perfectly Philip Arnold Director Certified ColdFusion Developer ASP Multimedia Limited T: +44 (0)20 8680 1133 "Websites for the real world" ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re:RE: Request Scope
Is any one out there using the request variables extensively? I'd like to know more about the request scope and how to use it. I've found very little in my documentation (4.0.1) and have searched the allaire knowledge base with no obvious results (a lot comes up but the titles lead me to believe they were not pertinent). I've heard that using request scope variables can help limit the "need" for session and/or application variables so that the necessity of locking is minimized and in some cases eliminated. I also admit that I could have heard this out of context. Any clarification and information would be appreciated. Thanks, in advance, Carol Carol L. Bluestein Senior Programmer NYS Office of Real Property 518-486-6335 [EMAIL PROTECTED] Reply Separator____ Subject:RE: Request Scope Author: [EMAIL PROTECTED] Date: 2/1/01 8:06 PM > The "Request" scope was available in CF 4.0 wasn't it? Yup, just tested on our 4.0.1 server and it worked perfectly Philip Arnold Director Certified ColdFusion Developer ASP Multimedia Limited T: +44 (0)20 8680 1133 "Websites for the real world" ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Request Scope
> Is the duplicate function available in 4.01 or did it come > into being in 4.5n...? It's new to 4.5.x. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Request Scope
That is the "variables" scope which is the "default" scope for variables created with or in if another scope is not specified. #variables.myvar##request.myvar# To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Thursday, March 08, 2001 09:14 Subject: Request Scope > Is the requesy scope the scope that is used when say I set something > in the document so if I wanted to refer to that in > the document I would use #request.here# or is this a > different scope? > > Robert Everland III > Web Developer > Dixon Ticonderoga > > ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Request Scope
> Is the requesy scope the scope that is used when say I set something > in the document so if I wanted to refer to that in > the document I would use #request.here# or is this a > different scope? Request scope can be used if you want to pass information (without attributes) to modules The one you're probably thinking about is "variables" Philip Arnold Director Certified ColdFusion Developer ASP Multimedia Limited T: +44 (0)20 8680 1133 "Websites for the real world" ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Request Scope Woes
I have a section of code as follows: If I cfdump var="#request#"> just before the call i get the structure I would expect However if I do the dump as first line of stysheet01 I get only a single element in the struct which is created by the cffump tag (CFADUMPINITED). If I dump caller.request I get what I expect. It was my understanding that the request scope was passed to custom tags. If I replace the cf_stylesheet with a cfinclude the request scope is fine. What am I missing here? TIA Don ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: request scope.
I'm pretty sure it was 4.5. It was created for Spectra users (who apparently couldn't handle the thought of parameter passing and wanted to use only global variables). Are you writing a book? At 09:54 AM 01/31/2002 -0500, you wrote: >Anyone know for sure how long the request scope has been a part of >CF? What version in partic did it debut? -- Jeffry Houser | mailto:[EMAIL PROTECTED] AIM: Reboog711 | ICQ: 5246969 | Fax / Phone: 860-223-7946 -- Need a Web Developer? Contact me! My Book: Instant ColdFusion 5 | http://www.instantcoldfusion.com My New Book: ColdFusion: A Beginner's Guide February 2002 -- Far Cry Fly, Alternative Folk Rock http://www.farcryfly.com | http://www.mp3.com/FarCryFly __ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona 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: request scope.
It was 4.0.1, actually. -Original Message- From: Jeffry Houser [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 31, 2002 9:59 AM To: CF-Talk Subject: Re: request scope. I'm pretty sure it was 4.5. It was created for Spectra users (who apparently couldn't handle the thought of parameter passing and wanted to use only global variables). Are you writing a book? At 09:54 AM 01/31/2002 -0500, you wrote: >Anyone know for sure how long the request scope has been a part of >CF? What version in partic did it debut? -- Jeffry Houser | mailto:[EMAIL PROTECTED] AIM: Reboog711 | ICQ: 5246969 | Fax / Phone: 860-223-7946 -- Need a Web Developer? Contact me! My Book: Instant ColdFusion 5 | http://www.instantcoldfusion.com My New Book: ColdFusion: A Beginner's Guide February 2002 -- Far Cry Fly, Alternative Folk Rock http://www.farcryfly.com | http://www.mp3.com/FarCryFly __ Why Share? Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc 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: request scope.
You know I use request variables, but what do they do. Like when you say global, what do you mean by global? Robert Everland III Dixon Ticonderoga Web Developer Extraordinaire -Original Message- From: Jeffry Houser [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 31, 2002 9:59 AM To: CF-Talk Subject: Re: request scope. I'm pretty sure it was 4.5. It was created for Spectra users (who apparently couldn't handle the thought of parameter passing and wanted to use only global variables). Are you writing a book? At 09:54 AM 01/31/2002 -0500, you wrote: >Anyone know for sure how long the request scope has been a part of >CF? What version in partic did it debut? -- Jeffry Houser | mailto:[EMAIL PROTECTED] AIM: Reboog711 | ICQ: 5246969 | Fax / Phone: 860-223-7946 -- Need a Web Developer? Contact me! My Book: Instant ColdFusion 5 | http://www.instantcoldfusion.com My New Book: ColdFusion: A Beginner's Guide February 2002 -- Far Cry Fly, Alternative Folk Rock http://www.farcryfly.com | http://www.mp3.com/FarCryFly __ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona 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: request scope.
They are not global in the sense of application or server variables - in fact, I wouldn't use the word global at all. A request variable will exist for the entire request. So, if you set request.foo in Application.cfm, the template you called will have access to request.foo, as will any custom tag called. onRequestEnd.cfm will also have access to the variable. Request variables are NOT global at all. If I set request.foo to randrange(1,100), I will get a different request.foo variable then you will (most likely ;). === Raymond Camden, Principal Spectra Compliance Engineer for Macromedia Email: [EMAIL PROTECTED] Yahoo IM : morpheus "My ally is the Force, and a powerful ally it is." - Yoda > -Original Message- > From: Robert Everland [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 31, 2002 10:00 AM > To: CF-Talk > Subject: RE: request scope. > > > You know I use request variables, but what do they do. Like > when you say > global, what do you mean by global? > > Robert Everland III > Dixon Ticonderoga > Web Developer Extraordinaire > > -Original Message- > From: Jeffry Houser [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 31, 2002 9:59 AM > To: CF-Talk > Subject: Re: request scope. > > > I'm pretty sure it was 4.5. It was created for Spectra users (who > apparently couldn't handle the thought of parameter passing > and wanted to > use only global variables). > > Are you writing a book? > > At 09:54 AM 01/31/2002 -0500, you wrote: > >Anyone know for sure how long the request scope has been a part of > >CF? What version in partic did it debut? > > > > > -- > Jeffry Houser | mailto:[EMAIL PROTECTED] > AIM: Reboog711 | ICQ: 5246969 | Fax / Phone: 860-223-7946 > -- > Need a Web Developer? Contact me! > My Book: Instant ColdFusion 5 | http://www.instantcoldfusion.com > My New Book: ColdFusion: A Beginner's Guide February 2002 > -- > Far Cry Fly, Alternative Folk Rock > http://www.farcryfly.com | http://www.mp3.com/FarCryFly > > __ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona 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: request scope.
Then I stand corrected. ;) At 09:57 AM 01/31/2002 -0500, you wrote: >It was 4.0.1, actually. > > > >-Original Message- >From: Jeffry Houser [mailto:[EMAIL PROTECTED]] >Sent: Thursday, January 31, 2002 9:59 AM >To: CF-Talk >Subject: Re: request scope. > > > I'm pretty sure it was 4.5. It was created for Spectra users (who >apparently couldn't handle the thought of parameter passing and wanted >to >use only global variables). > > Are you writing a book? > >At 09:54 AM 01/31/2002 -0500, you wrote: > >Anyone know for sure how long the request scope has been a part of > >CF? What version in partic did it debut? > > > > >-- >Jeffry Houser | mailto:[EMAIL PROTECTED] >AIM: Reboog711 | ICQ: 5246969 | Fax / Phone: 860-223-7946 >-- >Need a Web Developer? Contact me! >My Book: Instant ColdFusion 5 | http://www.instantcoldfusion.com >My New Book: ColdFusion: A Beginner's Guide February 2002 >-- >Far Cry Fly, Alternative Folk Rock >http://www.farcryfly.com | http://www.mp3.com/FarCryFly > > __ Get Your Own Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb 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: request scope.
At 10:15 AM 01/31/2002 -0500, you wrote: >They are not global in the sense of application or server variables - in >fact, I wouldn't use the word global at all. A request variable will >exist for the entire request. So, if you set request.foo in >Application.cfm, the template you called will have access to >request.foo, as will any custom tag called. onRequestEnd.cfm will also >have access to the variable. They are global to the request, the same way that application or server variables are. Unlike application / server variables, they are not, persistent among separate requests. They are Global, but not persistent. I view each ColdFusion template as its own program. I don't see much use beyond "A way to avoid sending parameters to custom tags." Unless I'm mistaken the only difference between the variables scope and the request scope is that variables in the request scope are available to custom tags. >Request variables are NOT global at all. If I set request.foo to >randrange(1,100), I will get a different request.foo variable then you >will (most likely ;). You mean you will get a different request.foo variable for each request, correct? The value is not going to randomly change with each access? If it's the second scenario (not the first) then I am grossly misunderstanding the scope. If I were to set application.foo to randrange(1,100) I would also get a different value on every page request. In most situations (I'm sure you already know this) we try to avoid setting an application variable on each page request. I'm going to shut up now. -- Jeffry Houser | mailto:[EMAIL PROTECTED] AIM: Reboog711 | ICQ: 5246969 | Fax / Phone: 860-223-7946 -- Need a Web Developer? Contact me! My Book: Instant ColdFusion 5 | http://www.instantcoldfusion.com My New Book: ColdFusion: A Beginner's Guide February 2002 -- Far Cry Fly, Alternative Folk Rock http://www.farcryfly.com | http://www.mp3.com/FarCryFly __ Why Share? Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc 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: request scope.
> At 10:15 AM 01/31/2002 -0500, you wrote: > > They are global to the request, the same way that > application or server > variables are. Unlike application / server variables, they are not, > persistent among separate requests. > > They are Global, but not persistent. I view each > ColdFusion template as > its own program. Perhaps I'm being anal here, and, folks, feel free to just ignore me. But I still say global is a bad word. As I will describe below, you will see that the variables are NOT global. > I don't see much use beyond "A way to avoid sending > parameters to custom > tags." Unless I'm mistaken the only difference between the > variables scope > and the request scope is that variables in the request scope > are available > to custom tags. As well as onRequestEnd.cfm > > >Request variables are NOT global at all. If I set request.foo to > >randrange(1,100), I will get a different request.foo > variable then you > >will (most likely ;). > >You mean you will get a different request.foo variable for > each request, > correct? The value is not going to randomly change with each > access? If Yes, it will. That is why I'm saying that you are wrong about calling request a 'global' scope. It is only defined for the requst. So, if Bob hits your site, request.foo will be 5, for instance, and Mary will have 22. Make sense? -rc __ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona 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: request scope.
> I don't see much use [for the request scope] beyond "A way to > avoid sending parameters to custom tags." How about setting variables that are needed by nearly every request, and are used so frequently that locking the Application scope every time you need to read one would be annoying? I'm thinking of stuff used by : DSN, DB passwords, etc. The downside to this of course is the memory overhead with every request setting the same variables in memory for its duration. Obviously NOT nice for anything beyond low, low, low traffic sites. So I only use the Request scope like this for backend CMS's for small companies where there really are never going to be more than a few people in there at once. "What if the companies expand?" is the usual caveat. Well, I'm pretty sure the companies I'm talking about won't expand *that* much. And in the end, if they end up with problems with it, you just need to search the app for each mention of the Request vars you set, and convert it all to Application. Thinking of it, I suppose you could include a quick and set a temp local var from the Application stuff in the snippet for a , so the annoyance of coding that for every DB query is cut down... So I guess that would be the way to go for real future-proofing. But I digress :) - Gyrus - [EMAIL PROTECTED] work: http://www.tengai.co.uk play: http://www.norlonto.net - PGP key available __ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona 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: request scope.
> The downside to this of course is the memory overhead with > every request setting the same variables in memory for its > duration. Obviously NOT nice for anything beyond low, low, low > traffic sites. So I only use the Request scope like this for > backend CMS's for small companies where there really are > never going to be more than a few people in there at once. What?? Balderdash! (Wow, I've been waiting to use that word.) Yes, when you use a request variable, you are storing something in memory, but you could say the same thing about local variables as well. I seriously doubt you could slow down a server with a few request vars, or even many. _Yes_, you could slow it down if you made a few thousand, or stored a lot of data in a few variables, but again, you would have the same issue w/ local variables as well. === Raymond Camden, Principal Spectra Compliance Engineer for Macromedia Email: [EMAIL PROTECTED] Yahoo IM : morpheus "My ally is the Force, and a powerful ally it is." - Yoda __ Get Your Own Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb 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: request scope.
Raymond Camden wrote: >>The downside to this of course is the memory overhead with >>every request setting the same variables in memory for its >>duration. Obviously NOT nice for anything beyond low, low, low >>traffic sites. So I only use the Request scope like this for >>backend CMS's for small companies where there really are >>never going to be more than a few people in there at once. >> > > What?? Balderdash! (Wow, I've been waiting to use that word.) bal·der·dash n. Nonsense. [Possibly alteration of Medieval Latin balductum, posset.] source: http://www.dictionary.com/ Not everybody on the list is a native speaker. Jochem __ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona 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: request scope.
It seems to me that there is an underlying principle here that should be followed... Variables should always be set only within the context that they are used. If it is only used in one template, set it to the local scope. It seems that alot of people over-use the request scope when proper use of the attributes and caller scopes would suit just fine. Now I know that for CF coding, this sometimes doesn't amount to much, but think what would happen in any other language if everyone coded every variable in the global memory space. It seems that we may be regressing to earlier, less efficient coding methods. Getting my 2 cents in for what it is worth. David Schmidt __ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona 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: request scope.
At 10:48 AM 01/31/2002 -0500, you wrote: > > At 10:15 AM 01/31/2002 -0500, you wrote: > > > > > They are global to the request, the same way that > > application or server > > variables are. Unlike application / server variables, they are not, > > persistent among separate requests. > > > > They are Global, but not persistent. I view each > > ColdFusion template as > > its own program. > >Perhaps I'm being anal here, and, folks, feel free to just ignore me. >But I still say global is a bad word. As I will describe below, you will >see that the variables are NOT global. How would you define global, then? I suppose it is just a matter of perspective. They are not global to the server. They are not global to the application. They are global to the page request. > > I don't see much use beyond "A way to avoid sending > > parameters to custom > > tags." Unless I'm mistaken the only difference between the > > variables scope > > and the request scope is that variables in the request scope > > are available > > to custom tags. > >As well as onRequestEnd.cfm I use OnRequestEnd so rarely, I was unaware that the variables scope was not available to it. > > >Request variables are NOT global at all. If I set request.foo to > > >randrange(1,100), I will get a different request.foo > > variable then you > > >will (most likely ;). > > > >You mean you will get a different request.foo variable for > > each request, > > correct? The value is not going to randomly change with each > > access? If > >Yes, it will. That is why I'm saying that you are wrong about calling >request a 'global' scope. It is only defined for the requst. > >So, if Bob hits your site, request.foo will be 5, for instance, and Mary >will have 22. > >Make sense? Yes, but I believe you misunderstood my original statement. In the case above, there are two separate requests and therefore two separate values. Let's use the scenario you mentioned: Bob hits the site, request.foo is equal to 5. Mary hits the site and request.foo is equal to 22. Bob outputs request.foo and the value 5 is output (correct?) Mary outputs request.foo and the value is 22 (correct?) Bob's request ends Mary's request ends. Bob's value will not change when Mary hits the site. That is what I meant when I said the value will not randomly change with each access. I meant each time a single request accesses the variable. -- Jeffry Houser | mailto:[EMAIL PROTECTED] AIM: Reboog711 | ICQ: 5246969 | Fax / Phone: 860-223-7946 -- Need a Web Developer? Contact me! My Book: Instant ColdFusion 5 | http://www.instantcoldfusion.com My New Book: ColdFusion: A Beginner's Guide February 2002 -- Far Cry Fly, Alternative Folk Rock http://www.farcryfly.com | http://www.mp3.com/FarCryFly __ Get Your Own Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb 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: request scope.
At 03:47 PM 01/31/2002 +, you wrote: > > I don't see much use [for the request scope] beyond "A way to > > avoid sending parameters to custom tags." > >How about setting variables that are needed by nearly every >request, and are used so frequently that locking the Application >scope every time you need to read one would be annoying? >I'm thinking of stuff used by : DSN, DB passwords, etc. You have misunderstood my point. Using the application scope in the way you describe is no different than using the request scope. I am from the belief that custom tags should be made as modular as possible. That means you have parameters passed into (and out of) it or you have local variables. I consider accessing variables in the application or session or URL or request scope to be bad form. They decrease the modularity of the custom tag. Of course, one could argue that having a cfquery in your custom tag will decrease it's modularity enough to make it application specific anyway. So, yes, even things such as DSN, db, and passwords I would prefer to pass into a custom tag. -- Jeffry Houser | mailto:[EMAIL PROTECTED] AIM: Reboog711 | ICQ: 5246969 | Fax / Phone: 860-223-7946 -- Need a Web Developer? Contact me! My Book: Instant ColdFusion 5 | http://www.instantcoldfusion.com My New Book: ColdFusion: A Beginner's Guide February 2002 -- Far Cry Fly, Alternative Folk Rock http://www.farcryfly.com | http://www.mp3.com/FarCryFly __ Get Your Own Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb 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: request scope.
> > > >Perhaps I'm being anal here, and, folks, feel free to just ignore me. > >But I still say global is a bad word. As I will describe > below, you will > >see that the variables are NOT global. > > How would you define global, then? I suppose it is just a > matter of > perspective. > They are not global to the server. They are not global to the > application. They are global to the page request. I think my main worry was that people would not get the difference. Described as you have here - it makes more sense. Again, I'm being anal. Shoot me. ;) > >As well as onRequestEnd.cfm > > I use OnRequestEnd so rarely, I was unaware that the > variables scope was > not available to it. Like Application.cfm, it has it's own local scope, so, if you want to share stuff, the request scope is good for this. > Bob hits the site, request.foo is equal to 5. > Mary hits the site and request.foo is equal to 22. > Bob outputs request.foo and the value 5 is output (correct?) > Mary outputs request.foo and the value is 22 (correct?) > Bob's request ends > Mary's request ends. > > Bob's value will not change when Mary hits the site. That > is what I > meant when I said the value will not randomly change with > each access. I Well, to me, access = request. So thats why I disagreed with you. But again, I am just being anal. Mainly I want to make sure everyone else has a proper understanding as well. (Although knowing me, I made it worse. ;) Ok, back to Neo for me. === Raymond Camden, Principal Spectra Compliance Engineer for Macromedia Email: [EMAIL PROTECTED] Yahoo IM : morpheus "My ally is the Force, and a powerful ally it is." - Yoda __ Get Your Own Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb 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: request scope.
At 11:32 AM 01/31/2002 -0500, you wrote: > > > > > >Perhaps I'm being anal here, and, folks, feel free to just ignore me. > > >But I still say global is a bad word. As I will describe > > below, you will > > >see that the variables are NOT global. > > > > How would you define global, then? I suppose it is just a > > matter of > > perspective. > > They are not global to the server. They are not global to the > > application. They are global to the page request. > >I think my main worry was that people would not get the difference. >Described as you have here - it makes more sense. > >Again, I'm being anal. Shoot me. ;) Actually, can't I just hold a gun to your head and force you to tell me about NEO? > > >As well as onRequestEnd.cfm > > > > I use OnRequestEnd so rarely, I was unaware that the > > variables scope was > > not available to it. > >Like Application.cfm, it has it's own local scope, so, if you want to >share stuff, the request scope is good for this. I didn't know the Application.cfm had it's own local scope, separate from the page requested. >Well, to me, access = request. So thats why I disagreed with you. My original comment was unclear then. -- Jeffry Houser | mailto:[EMAIL PROTECTED] AIM: Reboog711 | ICQ: 5246969 | Fax / Phone: 860-223-7946 -- Need a Web Developer? Contact me! My Book: Instant ColdFusion 5 | http://www.instantcoldfusion.com My New Book: ColdFusion: A Beginner's Guide February 2002 -- Far Cry Fly, Alternative Folk Rock http://www.farcryfly.com | http://www.mp3.com/FarCryFly __ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona 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: request scope.
Raymond Camden wrote: > > Again, I'm being anal. Shoot me. ;) Only after Neo is released. Jochem __ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona 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: request scope.
Every other language that I can think of (and I can think of plenty) that use the term "global" regard items defined as by that term to be accessible across the application. Since, AFAIK, "global" is not defined in the CF language specification, I think that it would be a good idea to accept the broader application of the term if we are to use it with respect to CF. At 11:10 AM 1/31/2002 -0500, you wrote: > How would you define global, then? I suppose it is just a matter of >perspective. > They are not global to the server. They are not global to the >application. They are global to the page request. Cary Gordon The Cherry Hill Company __ Why Share? Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc 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: request scope.
>Actually, can't I just hold a gun to your head and force > you to tell me > about NEO? I'll be happy to tell you about Neo. It rocks! Of course, I'm biased. ;) > > > >As well as onRequestEnd.cfm > > > > > > I use OnRequestEnd so rarely, I was unaware that the > > > variables scope was > > > not available to it. > > > >Like Application.cfm, it has it's own local scope, so, if you want to > >share stuff, the request scope is good for this. > > I didn't know the Application.cfm had it's own local scope, > separate from > the page requested. Ack! Great - now I'm being stupid. Sorry, Application.cfm and onRequestend.cfm share the same local scope. === Raymond Camden, Principal Spectra Compliance Engineer for Macromedia Email: [EMAIL PROTECTED] Yahoo IM : morpheus "My ally is the Force, and a powerful ally it is." - Yoda __ Why Share? Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc 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: request scope.
> -Original Message- > From: Raymond Camden [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 31, 2002 11:33 AM > To: CF-Talk > Subject: RE: request scope. > > > > I use OnRequestEnd so rarely, I was unaware that the > > variables scope was > > not available to it. > > Like Application.cfm, it has it's own local scope, so, if you want to > share stuff, the request scope is good for this. As far as my testing went, any local variables creating in application.cfm are available to the specified .cfm file AND the onrequestend.cfm file, regardless of them being created in application.cfm or the called .cfm file, so I don't quite understand where you are both coming from (Jeffry and Ray). Andy __ Why Share? Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc 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: request scope.
At 11:42 AM 01/31/2002 -0500, you wrote: > >Actually, can't I just hold a gun to your head and force > > you to tell me > > about NEO? > >I'll be happy to tell you about Neo. It rocks! Of course, I'm biased. ;) Everything I want to know is under NDA still, I'm sure. >Ack! Great - now I'm being stupid. Sorry, Application.cfm and >onRequestend.cfm share the same local scope. :whew: That is what I thought. -- Jeffry Houser | mailto:[EMAIL PROTECTED] AIM: Reboog711 | ICQ: 5246969 | Fax / Phone: 860-223-7946 -- Need a Web Developer? Contact me! My Book: Instant ColdFusion 5 | http://www.instantcoldfusion.com My New Book: ColdFusion: A Beginner's Guide February 2002 -- Far Cry Fly, Alternative Folk Rock http://www.farcryfly.com | http://www.mp3.com/FarCryFly __ Why Share? Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc 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: request scope.
At 08:32 AM 01/31/2002 -0800, you wrote: >Every other language that I can think of (and I can think of plenty) that >use the term "global" regard items defined as by that term to be accessible >across the application. You bring up a good point, although it is sometimes hard to compare the web world to 'traditional' development. I was thinking of each request as a specific, separate program. That is only true if you do not take time to set up the cfapplication tag and use some form of session management. >Since, AFAIK, "global" is not defined in the CF language specification, I >think that it would be a good idea to accept the broader application of the >term if we are to use it with respect to CF. -- Jeffry Houser | mailto:[EMAIL PROTECTED] AIM: Reboog711 | ICQ: 5246969 | Fax / Phone: 860-223-7946 -- Need a Web Developer? Contact me! My Book: Instant ColdFusion 5 | http://www.instantcoldfusion.com My New Book: ColdFusion: A Beginner's Guide February 2002 -- Far Cry Fly, Alternative Folk Rock http://www.farcryfly.com | http://www.mp3.com/FarCryFly __ Why Share? Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc 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: request scope.
At 11:37 AM 01/31/2002 -0500, you wrote: > > -Original Message- > > From: Raymond Camden [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, January 31, 2002 11:33 AM > > To: CF-Talk > > Subject: RE: request scope. > > > > > > > I use OnRequestEnd so rarely, I was unaware that the > > > variables scope was > > > not available to it. > > > > Like Application.cfm, it has it's own local scope, so, if you want to > > share stuff, the request scope is good for this. > >As far as my testing went, any local variables creating in application.cfm >are available to the specified .cfm file AND the onrequestend.cfm file, >regardless of them being created in application.cfm or the called .cfm file, >so I don't quite understand where you are both coming from (Jeffry and Ray). I guess that just goes back to one of my original statements that the only difference between the variables scope and the request scope is that the request scope is available to custom tags, whereas the variables scope is not. -- Jeffry Houser | mailto:[EMAIL PROTECTED] AIM: Reboog711 | ICQ: 5246969 | Fax / Phone: 860-223-7946 -- Need a Web Developer? Contact me! My Book: Instant ColdFusion 5 | http://www.instantcoldfusion.com My New Book: ColdFusion: A Beginner's Guide February 2002 -- Far Cry Fly, Alternative Folk Rock http://www.farcryfly.com | http://www.mp3.com/FarCryFly __ Get Your Own Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb 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: request scope.
> > I don't see much use [for the request scope] beyond "A way to > > avoid sending parameters to custom tags." > > How about setting variables that are needed by nearly every > request, and are used so frequently that locking the Application > scope every time you need to read one would be annoying? > I'm thinking of stuff used by : DSN, DB passwords, etc. You can simply set these in the local Variables scope, as long as they won't be needed by custom tags within the application. Using the Request scope for variables so that they can be passed between the custom tag and calling page breaks the modularity of those custom tags, and you might argue that this should be avoided in a modular design. > The downside to this of course is the memory overhead with > every request setting the same variables in memory for its > duration. Obviously NOT nice for anything beyond low, low, low > traffic sites. So I only use the Request scope like this for > backend CMS's for small companies where there really are > never going to be more than a few people in there at once. The memory overhead is insignificant for this - there's literally no measurable cost for creating and destroying a bunch of variables on each page in most cases, unless you're creating and destroying recordsets, in which case the true cost is the cost of querying the database. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 __ Get Your Own Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb 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: request scope.
> Perhaps I'm being anal here, and, folks, feel free to just > ignore me. But I still say global is a bad word. As I will > describe below, you will see that the variables are NOT global. The problem with being anal is not knowing when to stop. You guys can argue all day about the usage of the word "global", but since it isn't defined within the CFML programming language, none of you can be correct "by definition". Personally, I find it useful to think of individual CF files as programs, when called directly by the browser (as opposed to being invoked through CFINCLUDE or CFMODULE), and within that model, the Request scope is certainly global - someone else calling the same file is running a separate copy of the program, with its own "global" variables. When describing the Request scope to students, I often find it useful to compare it to a "global" scope, but am generally careful to define this within the context described above. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 __ Get Your Own Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb 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: request scope.
> > The downside to this of course is the memory overhead with > > every request setting the same variables in memory for its > > duration. Obviously NOT nice for anything beyond low, low, low > > traffic sites. So I only use the Request scope like this for > > backend CMS's for small companies where there really are > > never going to be more than a few people in there at once. > > What?? Balderdash! (Wow, I've been waiting to use that word.) Yes, when > you use a request variable, you are storing something in memory, but you > could say the same thing about local variables as well. I've zero experience of high-traffic sites. So when this topic came up a while ago and a few people raised eyebrows at my habitual "stick all vars used on every request by multiple pages into the Request scope in Application.cfm" attitude, I kind of assumed I was only OK in doing this on low-traffic sites such as the ones I'm working on now. But yeah, looking again and thinking through it, having before every every request would take up just as much memory as in Application.cfm, and using request.DSN for every . Or maybe the former would take up more? If variables.tempDSN is set 10 times in one request, does it take up 10 times as much memory, or is it 'overwritten' each time? I know the vars here are of a trivial size, but I'm curious as to how all this works behind the scenes, for future reference :) - Gyrus - [EMAIL PROTECTED] work: http://www.tengai.co.uk play: http://www.norlonto.net - PGP key available __ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona 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: request scope
> I am from the belief that custom tags should be made as modular as > possible. > [. . .] > So, yes, even things such as DSN, db, and passwords I would prefer to > pass into a custom tag. I tend not to as I know I'm using the same system for all my sites. I guess if I posted a tag on a public site I'd adapt it if it contained a to demand DSN etc. as attributes. Thanks for the reminder ;) - Gyrus - [EMAIL PROTECTED] work: http://www.tengai.co.uk play: http://www.norlonto.net - PGP key available __ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona 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: request scope.
Jeffry Houser said: > I don't see much use beyond "A way to avoid sending > parameters to custom tags." Unless I'm mistaken the > only difference between the variables scope and the > request scope is that variables in the request scope > are available to custom tags. Actually, I just thought I'd mention a use that I hadn't seen addressed so far: making sure that something is done only once per request. For instance, if I have a general-use custom tag that puts some JavaScript helper functions in a page, but the tag could possibly be called many times within the page or its custom tags or so on, I wouldn't want to output those JavaScript functions more than once. Specifically, I use it for a Date Picker popup for my HTML forms. I set something like Reqest.DatePickerFunctionsSent=1 and then the tag is smart enough to StructKeyExists() before it outputs the functions. This would apply to both CFMODULE-based custom tags and CFINCLUDE-d templates. I also use it for queries for navigational menus. We have a moderately complex intranet with a hierarchical navigation system that is rights-based. That is, everyone in the company sees a slightly different tree of navigation options. The query to generate those navigation trees is fast, but not instantaneous. In certain layouts of our intranet, the navigation may be shown (in different forms) in up to 4 different places in a single page. (Big and complete nav bar running down the left side, user's most-used options in a DHTML layer behind that, and top and bottom horizontal rows of the top-level items.) Obviously, we'd only need to run the query once per request. Throw it in the Request scope and anything can use it. We even ended up using it to eliminate some of our other permissions checking, consolidating all of our rights requests into one query that also produced navigation. ("This is everything on the site that this user has access to, along with their rights for each object, and all of the objects are arranged in this hierarchy.") The custom tags that would then otherwise be running their own query, to see if they had rights to be used, instead do a quick check through the cached query. HTH, -R P.S. - Before you mention it, while I could probably get away with using Session vars to hold the query, we actually find that it's easier to just use Request, as the navigation items and rights change more often than you would think. I had even built such a system where one person could change another person's rights and it would mark their cached query as needing to be refreshed, but it was so hopelessly complex an non-intuitive that it would have been a nightmare for anyone else to maintain, no matter how much documentation I had supplied. I'm not by any means saying it shouldn't be done that way, just that it wasn't worth it to us. If our db server ever gets to the point where it can't handle the strain, I can always go back to the Session implementation. Until then, however, RAM prices are cheaper than programmer hours. -R __ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona 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: request scope.
At 12:44 PM 01/31/2002 -0500, you wrote: >Actually, I just thought I'd mention a use that I hadn't seen addressed so >far: making sure that something is done only once per request. For >instance, if I have a general-use custom tag that puts some JavaScript >helper functions in a page, but the tag could possibly be called many times >within the page or its custom tags or so on, I wouldn't want to output those >JavaScript functions more than once. I might argue that if you have code that does nothing more than drop in JavaScript functions, and that code can be called multiple times during a single page request, then you may need to re-think your logic if you have code that does nothing more. The code does not sound modular enough. The only good argument I have ever heard for using a custom tag to insert JavaScript into a page is that the same JavaScript is used across multiple sites on the same server (and you don't want to have to worry about updating it in multiple places if you make a change); so I hope that is what you are doing. >Specifically, I use it for a Date Picker popup for my HTML forms. I set >something like Reqest.DatePickerFunctionsSent=1 and then the tag is smart >enough to StructKeyExists() before it outputs the functions. This would >apply to both CFMODULE-based custom tags and CFINCLUDE-d templates. It sounds to me like you developed a work-around for bad design choices. >I also use it for queries for navigational menus. We have a moderately >complex intranet with a hierarchical navigation system that is rights-based. >That is, everyone in the company sees a slightly different tree of >navigation options. The query to generate those navigation trees is fast, >but not instantaneous. In certain layouts of our intranet, the navigation >may be shown (in different forms) in up to 4 different places in a single >page. (Big and complete nav bar running down the left side, user's >most-used options in a DHTML layer behind that, and top and bottom >horizontal rows of the top-level items.) Obviously, we'd only need to run >the query once per request. Throw it in the Request scope and anything can >use it. I suppose if your custom tags need use of the query, that is a functional way to approach it. Otherwise, no need to copy it into the request scope. My preference would, of course, be to just pass the query as a parameter into the custom tag without copying it into the request scope. -- Jeffry Houser | mailto:[EMAIL PROTECTED] AIM: Reboog711 | ICQ: 5246969 | Fax / Phone: 860-223-7946 -- Need a Web Developer? Contact me! My Book: Instant ColdFusion 5 | http://www.instantcoldfusion.com My New Book: ColdFusion: A Beginner's Guide February 2002 -- Far Cry Fly, Alternative Folk Rock http://www.farcryfly.com | http://www.mp3.com/FarCryFly __ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona 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: request scope.
Here here. I regularly pass the DSN as an attribute to my custom tags. > I am from the belief that custom tags should be made as modular as > possible. That means you have parameters passed into (and out of) it or > you have local variables. I consider accessing variables in the > application or session or URL or request scope to be bad form. They > decrease the modularity of the custom tag. Of course, one could argue th at > having a cfquery in your custom tag will decrease it's modularity enough to > make it application specific anyway. > > So, yes, even things such as DSN, db, and passwords I would prefer to > pass into a custom tag. > > > -- > Jeffry Houser | mailto:[EMAIL PROTECTED] > AIM: Reboog711 | ICQ: 5246969 | Fax / Phone: 860-223-7946 > -- > Need a Web Developer? Contact me! > My Book: Instant ColdFusion 5 | http://www.instantcoldfusion.com > My New Book: ColdFusion: A Beginner's Guide February 2002 > -- > Far Cry Fly, Alternative Folk Rock > http://www.farcryfly.com | http://www.mp3.com/FarCryFly > __ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona 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: Request Scope.
I use the request scope because those variables are (as I understand it) available globally -- in templates, app.cfm, and custom tag files. Pete - Original Message - From: "Martin Sutton" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Wednesday, February 20, 2002 8:08 AM Subject: Request Scope. > Hi all, > > Can any of you explain to me why the request scope is useful, if indeed, it > is? It is one of the few scopes I am unfamiliar with. Can it be used to > enhance my code? > > Regards, > > Martin. > __ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona 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: Request Scope.
Think of the Request scope like Session scope for a single HTTP request. Variables set in the Request scope are available to all templates accessed during that single request. For example you could read a Request scope variable in that was set in a custom tag. Unlike Session variables Request scope variables are single threaded and therefore do not have to be locked when you read and write them. I hope that helps you see how they can be very useful in developing applications. Regards, > Dan Rosenbaum > Wachovia Securities > Corporate & Investment Banking > [EMAIL PROTECTED] > > -Original Message- > From: Martin Sutton [SMTP:[EMAIL PROTECTED]] > Sent: Wednesday, February 20, 2002 8:08 AM > To: CF-Talk > Subject: Request Scope. > > Hi all, > > Can any of you explain to me why the request scope is useful, if indeed, > it > is? It is one of the few scopes I am unfamiliar with. Can it be used to > enhance my code? > > Regards, > > Martin. > __ Get Your Own Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb 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: Request Scope.
> Can any of you explain to me why the request scope is useful, > if indeed, it is? It is one of the few scopes I am unfamiliar > with. Can it be used to enhance my code? The Request scope is like the local Variables scope, with one major difference - any variables within it are available not only to your page, but to any custom tags called by your page (and any custom tags called by those tags, and so on). There's also one minor difference - you have to explicitly specify the Request scope to create variables within it. The primary use of this is to allow easier data sharing among all parts of a page generating a response to a single request. For example, Spectra uses quite a few custom tags, which themselves use custom tags, and so on. Rather than passing data up and down the chain of tags (into tags via attributes, out of tags via the Caller scope), the Spectra tags use the Request scope. As for whether it can be used to enhance your code, who knows? It's just another option when you're using custom tags. You may choose not to use it - personally, I think that custom tags should be "decoupled" as much as possible from the calling page, and generally shy away from using the Request scope to share data between these tags and their calling page, but others may certainly differ (and I might change my mind also, if I were building something like Spectra). I tend to use the Request scope for what I think of as "constants" - variables that I set with essentially static values in Application.cfm - but I could certainly use the local Variables scope just the same. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 __ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona 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: Request Scope.
Thanks to everyone who replied to that request (no pun intended). I will look into it further based on the information you provided. Martin. -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED]] Sent: 20 February 2002 15:06 To: '[EMAIL PROTECTED]' Cc: '[EMAIL PROTECTED]' Subject: RE: Request Scope. > Can any of you explain to me why the request scope is useful, > if indeed, it is? It is one of the few scopes I am unfamiliar > with. Can it be used to enhance my code? The Request scope is like the local Variables scope, with one major difference - any variables within it are available not only to your page, but to any custom tags called by your page (and any custom tags called by those tags, and so on). There's also one minor difference - you have to explicitly specify the Request scope to create variables within it. The primary use of this is to allow easier data sharing among all parts of a page generating a response to a single request. For example, Spectra uses quite a few custom tags, which themselves use custom tags, and so on. Rather than passing data up and down the chain of tags (into tags via attributes, out of tags via the Caller scope), the Spectra tags use the Request scope. As for whether it can be used to enhance your code, who knows? It's just another option when you're using custom tags. You may choose not to use it - personally, I think that custom tags should be "decoupled" as much as possible from the calling page, and generally shy away from using the Request scope to share data between these tags and their calling page, but others may certainly differ (and I might change my mind also, if I were building something like Spectra). I tend to use the Request scope for what I think of as "constants" - variables that I set with essentially static values in Application.cfm - but I could certainly use the local Variables scope just the same. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 __ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona 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: Request Scope.
Lastly, I feel one of the most important uses of request scope is as a replacement for improper usage of application scope. A bad habit many developers acquire is to specify all sorts of global variables in the application.cfm, such as . Shared scope variables MUST be locked for reliability, but there is serious overhead involved. Request scoped variables do not have to be locked and are a better fit here. Yes, you could use simple local variables for this purpose, but then they are hidden from your custom tags. I avoid the shared scope variables (especially application and server), using only when necessary. Request scope makes an excellent non-persistent global variable. - Chuck -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 20, 2002 10:06 AM To: CF-Talk Subject: RE: Request Scope. > Can any of you explain to me why the request scope is useful, > if indeed, it is? It is one of the few scopes I am unfamiliar > with. Can it be used to enhance my code? The Request scope is like the local Variables scope, with one major difference - any variables within it are available not only to your page, but to any custom tags called by your page (and any custom tags called by those tags, and so on). There's also one minor difference - you have to explicitly specify the Request scope to create variables within it. The primary use of this is to allow easier data sharing among all parts of a page generating a response to a single request. For example, Spectra uses quite a few custom tags, which themselves use custom tags, and so on. Rather than passing data up and down the chain of tags (into tags via attributes, out of tags via the Caller scope), the Spectra tags use the Request scope. As for whether it can be used to enhance your code, who knows? It's just another option when you're using custom tags. You may choose not to use it - personally, I think that custom tags should be "decoupled" as much as possible from the calling page, and generally shy away from using the Request scope to share data between these tags and their calling page, but others may certainly differ (and I might change my mind also, if I were building something like Spectra). I tend to use the Request scope for what I think of as "constants" - variables that I set with essentially static values in Application.cfm - but I could certainly use the local Variables scope just the same. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 __ Get Your Own Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb 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
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 ~| 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 variables
On 9/7/00, Aidan Whitehall penned: >Can anyone explain what request scope variables are and when to use them? A >little sample code would be really helpful :-) > >CF Studio help has a paragraph on the page "Passing Attribute Values between >Custom Tags", but it didn't help much and a search on allaire.com didn't >produce anything valuable. From what I understand, request is just like any local variables scope. The difference being, if you need to access the first 2 inside of a custom tag, you'd have to pass it into the tag then access it with the attributes scope. or The inside the custom tag: Where with the request variable, you could access it directly. Then inside: Of course, it's not limited to datasource names. Any variable that you set outside the tag that you need to access inside the tag can be accessed directly without referencing them in the caller tag if you set them with the request scope. -- Bud Schneehagen - Tropical Web Creations _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ ColdFusion Solutions / eCommerce Development [EMAIL PROTECTED] http://www.twcreations.com/ 954.721.3452 -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: Request scope variables
> Can anyone explain what request scope variables are and when > to use them? A little sample code would be really helpful :-) > > CF Studio help has a paragraph on the page "Passing Attribute > Values between Custom Tags", but it didn't help much and a search > on allaire.com didn't produce anything valuable. The Request scope is available to all scripts used to generate a single response to a request. So, let's say you call index.cfm from your browser, and index.cfm calls the cf_foo custom tag, which in turn calls the cf_bar custom tag, which in turn recurses. The Request scope will be the same for all of them, as opposed to the local variables scope which will be unique to each of them. I find the Request scope to be useful for two things: 1. Setting "constants" which should be available to all scripts within an application, including custom tags. Some people use the Application scope for this, but if I can avoid having one more thing that needs a CFLOCK, I'm happy. The Request scope is ideal for this. 2. Dealing with variables through multiple custom tag iterations (recursion, etc). It's my understanding that this is specifically why the Request scope was introduced - Spectra uses so many custom tags in this way that it would have been much more difficult without the Request scope. Sorry, but no code sample. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: Request scope variables
Request scope variables are the same as Variables scope variables EXCEPT that are global across all Custom Tags and CFMODULE calls. They are created when you first set them, and they disappear at the end of the page request. If you set Request.myvar = 5 in the calling file, then call a CF_MODULE or a Custom Tag (same thing) Request.myvar will still be 5 in the module. If you change it in the module, when the module finishes the calling file will have the changed value. This is useful for when you want to use a value anywhere, no matter how nested your modules are. For example, you may want to set: So you can use #Request.DSN# anywhere in your files, even in your modules. Of course Application variables would also be available anywhere but you have to lock those... At 10:05 AM 9/7/00 +0100, Aidan Whitehall wrote: >The ColdFusion Locking Best Practices article >http://www.allaire.com/handlers/index.cfm?ID=17318&Method=Full&Title=ColdFus >ion%20Locking%20Best%20Practices&Cache=False >talks about using the request scope when you want to use application >variables for DSN names > >Can anyone explain what request scope variables are and when to use them? A >little sample code would be really helpful :-) > >CF Studio help has a paragraph on the page "Passing Attribute Values between >Custom Tags", but it didn't help much and a search on allaire.com didn't >produce anything valuable. > > >Thanks in advance > >-- >Aidan Whitehall <[EMAIL PROTECTED]> >Netshopper UK Ltd >Advanced Web Solutions & Services > >http://www.netshopperuk.com/ >Telephone +44 (01744) 648650 >Fax +44 (01744) 648651 >-- >Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ >To Unsubscribe visit >http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a >message to [EMAIL PROTECTED] with 'unsubscribe' in the body. --- Peter Theobald, Chief Technology Officer LiquidStreaming http://www.liquidstreaming.com [EMAIL PROTECTED] Phone 1.212.545.1232 Fax 1.212.679.8032 -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: Request scope variables
Great - thanks for everyone's replies on this thread. Which kind of leads me to another question... Why not just set all application variables as request scope variables in the Application.cfm file and reduce the amount of time spent CFLOCKing application variables? So long as you're careful naming your variables, this could be pretty useful, *but* it smacks of using a 1-pixel transparent .gif to obtain white space... right? -- Aidan Whitehall <[EMAIL PROTECTED]> Netshopper UK Ltd Advanced Web Solutions & Services http://www.netshopperuk.com/ Telephone +44 (01744) 648650 Fax +44 (01744) 648651 -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: Request scope variables
> Why not just set all application variables as request scope > variables in the Application.cfm file and reduce the amount > of time spent CFLOCKing application variables? I'd recommend doing exactly that, for variables you're setting in application.cfm and not changing (essentially, variables being used as constants). However, you may have some application variables which you're changing over the lifespan of the application, and these of course would have to remain in the Application scope. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: Request scope variables
On Mon, 11 Sep 2000 10:18:25 -0400, Dave Watts <[EMAIL PROTECTED]> wrote: >> Why not just set all application variables as request scope >> variables in the Application.cfm file and reduce the amount >> of time spent CFLOCKing application variables? > >I'd recommend doing exactly that, for variables you're setting in >application.cfm and not changing (essentially, variables being used as >constants). > >However, you may have some application variables which you're changing over >the lifespan of the application, and these of course would have to remain in >the Application scope. Are request variables new to version 4.5? I'm developing on 4.5, but have to deploy some projects on 4.0. I can't find any mention of it in the docs or in CFWACK or Danesh... __ Kay Smoljak - HTML/ColdFusion Developer - PerthWeb Pty Ltd Internet Solutions for your business! Level 9/105 St George's Tc - Perth - Western Australia Ph: (08) 9226 1366 Fax: (08) 9226 1375 Mobile : 0419 949 007 Visit Perth online! : www.perthweb.com.au -- Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: Mysterious Request Scope
> I have seen a few references to the REQUEST scope by many on > this list. Is this a standard scope that is available to all > CF pages? What is stored in this structure? Is there any > information on it in the CF documentation? When does it get > built? The Request scope is available to all scripts that are used within a single response to a single HTTP request, whether those scripts are called directly via the URL, or with CFINCLUDE or as custom tags. This scope was introduced in CF 4.x. By default, nothing is stored in this scope unless you put it there. As for whether it's described in the documentation, I suspect that it's mentioned at least. There are at least a couple good uses for this scope. One is with deeply nested custom tags. The Request scope will be available to all custom tags within a page, no matter how deeply nested they are. Another good use for the Request scope is for constants. Typically, people use Application variables for things like datasource names and other constants which don't change over the life of the application. Request variables provide an alternative - and you don't have to worry about CFLOCK with them. On the other hand, you'd need to create them again for each page request, so you'd just plonk them down in application.cfm, typically. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED]
RE: Mysterious Request Scope
This is from the ColdFusion Quick Reference Guide "Request variables store data that pertains to the processing of a single page request. Request variables allow you to store data in a structure that can be passed to nested tags, such as Custom Tags, and processed once. Set a Request variable to provide information to nested tags. The Request variable is set as follows: Each nested tag can access the variable with the tag: #Request.field_name1#" -Original Message- From: Mark Johnson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 24, 2000 1:55 AM To: CF-Talk Subject: Mysterious Request Scope I have seen a few references to the REQUEST scope by many on this list. Is this a standard scope that is available to all CF pages? What is stored in this structure? Is there any information on it in the CF documentation? When does it get built? Mark Johnson --- Senior Cold Fusion Developer Cardinal Communications Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED] Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED]
RE: Mysterious Request Scope
> ... This scope was introduced in CF 4.x. By default, nothing is stored in this scope unless you put it > there. CF 4.01. Wasn't there in 4.0 > As for whether it's described in the documentation, I suspect that it's > mentioned at least. A possible reason for its obscurity is that it would have missed the 4.0 docs which may not have been updated sufficiently for the 4.01 release. In addition, most ppl would have d/led the 4.01 electronic update w/o docs. FWIW Steve Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED]
RE: Mysterious Request Scope
There has been some use of the request scope for global variables in the Fusebox methodology. You can read more about how it's being used from this Powerpoint presentation which was given by Gabe Roffman at the first Fusebox conference last month: http://www.fusebox.org/content/index.cfm?fuseaction=presentations Hope this helps. Shane Witbeck -Original Message- From: Jones, Matt [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 24, 2000 11:11 AM To: CF-Talk Subject: RE: Mysterious Request Scope This is from the ColdFusion Quick Reference Guide "Request variables store data that pertains to the processing of a single page request. Request variables allow you to store data in a structure that can be passed to nested tags, such as Custom Tags, and processed once. Set a Request variable to provide information to nested tags. The Request variable is set as follows: Each nested tag can access the variable with the tag: #Request.field_name1#" -Original Message- From: Mark Johnson [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 24, 2000 1:55 AM To: CF-Talk Subject: Mysterious Request Scope I have seen a few references to the REQUEST scope by many on this list. Is this a standard scope that is available to all CF pages? What is stored in this structure? Is there any information on it in the CF documentation? When does it get built? Mark Johnson --- Senior Cold Fusion Developer Cardinal Communications Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED] Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED] Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED]
Re: Mysterious Request Scope
It's similar to variables scope, except it is globally available across CFMODULE and custom tags. At 07:54 AM 10/24/00 +0100, Mark Johnson wrote: >I have seen a few references to the REQUEST scope by many on this list. Is >this a standard scope that is available to all CF pages? What is stored in >this structure? Is there any information on it in the CF documentation? >When does it get built? > >Mark Johnson >--- >Senior Cold Fusion Developer >Cardinal Communications > > >Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ >Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message >with 'unsubscribe' in the body to [EMAIL PROTECTED] --- Peter Theobald, Chief Technology Officer LiquidStreaming http://www.liquidstreaming.com [EMAIL PROTECTED] Phone 1.212.545.1232 x204 Fax 1.212.545.0938 Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message with 'unsubscribe' in the body to [EMAIL PROTECTED]
Re: Request Scope Questions
I may be wrong but once set (eg: in the application.cfm file) if you do not provide a scope (eg: Application., Session., Client., they become variables in the REQUEST scope. You can then access them anywhere in a template without using a scope, eg: You should be able to access this without Application or Request. Not sure about the locking. however At 17:45 10/11/01 -0800, you wrote: >I've been trying to brush up on my CF skills and I'm a bit confused with > Request Variables. > >I've been through Ben Forta's CF5 Construction Kit and Danesh CF4 books and > I only see reference to Request Variables in discussions of Custom Tags as > a variable type that can be shared and changed by both the custom tag and > the calling template. That makes sense to me, if I understand it > correctly. > >But I have also seen the Request Scope mentioned on this list and in sample > code in other contexts. Some defining Application variables such as > datasource name and User Access data. > >So I guess my question are: > >1. What exacty is the Request Scope? > >2. How are Request Variables similar or different from Session or > Application Variables? > >3. When should/shouldn't Request Variables be used? > >4. What about locking? I've read that Request Variables don't need to be > locked. Is that true? Why not? > >TIA > >Terry > > > > ~~ 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: Request Scope Questions
> I've been trying to brush up on my CF skills and I'm a bit confused with > Request Variables. The request scope lasts for the duration of each request. If you define request.var, every file (includes, custom tags, whatever) that's processed from then on in the course of that HTTP request has access to request.var. Session variables persist for as long as the session timeout (set in CF Admin or tag), and are specific to each client. Application variables' persistence are again controlled by CF Admin or settings, and are specific to each application (as defined with the tag). Both session and application variables (and server variables) need to be locked when read or written to. Check out ColdFusion Locking Best Practices http://www.allaire.com/Handlers/index.cfm?ID=17318 Locking in ColdFusion http://www.allaire.com/handlers/index.cfm?ID=17196 To Lock or Not To Lock http://www.defusion.com/articles/index.cfm?ArticleID=105 for different views of locking. I found these articles kind of confusing when taken together, each has a different angle. But you should gain something between them. I don't understand the technicalities of locking, but as I understand it the risk of clashes in CF accessing application/session/server variables is due to how they are stored in memory. There's the risk of memory leaks if there's a clash here. The request scope is treated differently and doesn't carry that risk (wow, listen to the tech jargon! ;) and hence you don't need to put a lock around each time a request variable is written to or read from. Request variables are often talked of just in the context of custom tags, cos the fact that they can be accessed from anywhere during one request means they're useful for custom tags to talk to each other. But I use them quite a bit. I set all stuff like DSN names and passwords in application.cfm using the request scope. Also, any session variables that are needed frequently, I transfer them to the request scope in application.cfm. That way, I put one lock around this chunk of 'transfer' code, and don't need to lock every time a session variable is needed. A couple of notes here: if you do this, use something like to transfer the variable. If you don't use Duplicate() - correct me if I'm wrong someone! - then request.var just becomes a 'pointer' to session.var, and session.var is still actually read when you refer later to request.var (rendering the whole business kind of redundant!). Duplicate() - which is only available in CF4.5+ - makes request.var a 'deep' copy of session.var, and then request.var technically has nothing to do with session.var except having the same value. Also, I think the 'scope' attribute of is new in 4.5 (one of those articles above explains how to use it). Use it! I think there was a recent thread about how this kind of practice affects processing speed. I haven't yet done any really high-traffic sites where this might be a concern, so the convenience of the request scope is great, for now. hth, - Gyrus ~~ 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: Request Scope Questions
Your description is right on target with regard to request scope. Wasn't aware of the point Peter brought up about request being the default. Request scope is a local scope, like the variables scope, which unlike request does NOT persist to CFMODULE or custom tag calls. Its just handier to reference a local var as a request var by default. You would want to use the variables scope for local vars that you expressly did not want to cross template lines, so to speak. Otherwise I think request is just the flavor of choice for a local var. - Matt Robertson [EMAIL PROTECTED] MSB Designs, Inc. http://mysecretbase.com - - Original Message - From: "Terry Hogan" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Saturday, November 10, 2001 5:45 PM Subject: Request Scope Questions I've been trying to brush up on my CF skills and I'm a bit confused with Request Variables. I've been through Ben Forta's CF5 Construction Kit and Danesh CF4 books and I only see reference to Request Variables in discussions of Custom Tags as a variable type that can be shared and changed by both the custom tag and the calling template. That makes sense to me, if I understand it correctly. But I have also seen the Request Scope mentioned on this list and in sample code in other contexts. Some defining Application variables such as datasource name and User Access data. So I guess my question are: 1. What exacty is the Request Scope? 2. How are Request Variables similar or different from Session or Application Variables? 3. When should/shouldn't Request Variables be used? 4. What about locking? I've read that Request Variables don't need to be locked. Is that true? Why not? TIA Terry ~~ 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: Request Scope Questions
Thanks for the tips...it was educational! - Kinley >From: "gyrus" <[EMAIL PROTECTED]> >Reply-To: [EMAIL PROTECTED] >To: CF-Talk <[EMAIL PROTECTED]> >Subject: Re: Request Scope Questions >Date: Sun, 11 Nov 2001 03:59:32 - > > > I've been trying to brush up on my CF skills and I'm a bit confused with > > Request Variables. > >The request scope lasts for the duration of each request. If >you define request.var, every file (includes, custom tags, >whatever) that's processed from then on in the course of >that HTTP request has access to request.var. > >Session variables persist for as long as the session timeout >(set in CF Admin or tag), and are specific to each >client. Application variables' persistence are again controlled >by CF Admin or settings, and are specific to each >application (as defined with the tag). > >Both session and application variables (and server variables) >need to be locked when read or written to. Check out > >ColdFusion Locking Best Practices >http://www.allaire.com/Handlers/index.cfm?ID=17318 > >Locking in ColdFusion >http://www.allaire.com/handlers/index.cfm?ID=17196 > >To Lock or Not To Lock >http://www.defusion.com/articles/index.cfm?ArticleID=105 > >for different views of locking. I found these articles kind of confusing >when taken together, each has a different angle. But you should >gain something between them. I don't understand the technicalities of >locking, but as I understand it the risk of clashes in CF accessing >application/session/server variables is due to how they are stored >in memory. There's the risk of memory leaks if there's a clash here. >The request scope is treated differently and doesn't carry that >risk (wow, listen to the tech jargon! ;) and hence you don't need >to put a lock around each time a request variable is written to or >read from. > >Request variables are often talked of just in the context of custom >tags, cos the fact that they can be accessed from anywhere >during one request means they're useful for custom tags to >talk to each other. But I use them quite a bit. I set all stuff >like DSN names and passwords in application.cfm using the >request scope. Also, any session variables that are needed >frequently, I transfer them to the request scope in application.cfm. >That way, I put one lock around this chunk of 'transfer' code, >and don't need to lock every time a session variable is needed. > >A couple of notes here: if you do this, use something like > > > >to transfer the variable. If you don't use Duplicate() - correct >me if I'm wrong someone! - then request.var just becomes a >'pointer' to session.var, and session.var is still actually read when >you refer later to request.var (rendering the whole business kind >of redundant!). Duplicate() - which is only available in CF4.5+ - >makes request.var a 'deep' copy of session.var, and then >request.var technically has nothing to do with session.var >except having the same value. > >Also, I think the 'scope' attribute of is new in 4.5 (one >of those articles above explains how to use it). Use it! > >I think there was a recent thread about how this kind of practice >affects processing speed. I haven't yet done any really high-traffic >sites where this might be a concern, so the convenience of the >request scope is great, for now. > >hth, > >- Gyrus > > > ~~ 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: Request Scope Questions
if i understand correctly, a week or so ago you (dave) mentioned that duplicate was only necessary for a session structure if it contained other complex variables. you said that StructCopy was sufficient if it was merely a structure with simple variables. is this correct? christopher olive, cto, vp of web development cresco technologies, inc 410.825.0383 http://www.crescotech.com -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED]] Sent: Sunday, November 11, 2001 5:00 PM To: CF-Talk Subject: RE: Request Scope Questions > A couple of notes here: if you do this, use something like > > > > to transfer the variable. If you don't use Duplicate() - correct > me if I'm wrong someone! - then request.var just becomes a 'pointer' > to session.var, and session.var is still actually read when you > refer later to request.var (rendering the whole business kind of > redundant!). Duplicate() - which is only available in CF4.5+ - > makes request.var a 'deep' copy of session.var, and then request.var > technically has nothing to do with session.var except having the > same value. It's only necessary to use Duplicate in this case if Session.var is a structure or a query. If it's just a simple value, you don't need to worry - simple values are always passed by value, not by reference. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~ 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: Request Scope Questions
I don't know if Dave said that or not, but the statement is correct. In general, I just always use Duplicate. Perhaps structcopy is 0.001% faster, but to be honest, I'd rather just use Duplicate() which I know will always work right. Bare in mind that CF 4.5 had a um, 'issue' with Duplicate. You can download a hotfix for it though. === Raymond Camden, Principal Spectra Compliance Engineer for Macromedia Email: [EMAIL PROTECTED] Yahoo IM : morpheus "My ally is the Force, and a powerful ally it is." - Yoda > -Original Message- > From: Christopher Olive [mailto:[EMAIL PROTECTED]] > Sent: Monday, November 12, 2001 10:21 AM > To: CF-Talk > Subject: RE: Request Scope Questions > > > if i understand correctly, a week or so ago you (dave) mentioned that > duplicate was only necessary for a session structure if it contained > other complex variables. you said that StructCopy was > sufficient if it > was merely a structure with simple variables. is this correct? > > christopher olive, cto, vp of web development > cresco technologies, inc > 410.825.0383 > http://www.crescotech.com > > > -Original Message- > From: Dave Watts [mailto:[EMAIL PROTECTED]] > Sent: Sunday, November 11, 2001 5:00 PM > To: CF-Talk > Subject: RE: Request Scope Questions > > > > A couple of notes here: if you do this, use something like > > > > > > > > to transfer the variable. If you don't use Duplicate() - correct > > me if I'm wrong someone! - then request.var just becomes a > 'pointer' > > to session.var, and session.var is still actually read when you > > refer later to request.var (rendering the whole business kind of > > redundant!). Duplicate() - which is only available in CF4.5+ - > > makes request.var a 'deep' copy of session.var, and then > request.var > > technically has nothing to do with session.var except having the > > same value. > > It's only necessary to use Duplicate in this case if Session.var is a > structure or a query. If it's just a simple value, you don't need to > worry - > simple values are always passed by value, not by reference. > > Dave Watts, CTO, Fig Leaf Software > http://www.figleaf.com/ > voice: (202) 797-5496 > fax: (202) 797-5444 > > ~~ 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
FW: Request Scope Questions
If this is the case, is there any disadvantage of doing duplicate rather than structcopy? - It would seem that duplicate would always work... -Original Message- From: Christopher Olive [mailto:[EMAIL PROTECTED]] Sent: 12 November 2001 15:21 To: CF-Talk Subject: RE: Request Scope Questions if i understand correctly, a week or so ago you (dave) mentioned that duplicate was only necessary for a session structure if it contained other complex variables. you said that StructCopy was sufficient if it was merely a structure with simple variables. is this correct? christopher olive, cto, vp of web development cresco technologies, inc 410.825.0383 http://www.crescotech.com -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED]] Sent: Sunday, November 11, 2001 5:00 PM To: CF-Talk Subject: RE: Request Scope Questions > A couple of notes here: if you do this, use something like > > > > to transfer the variable. If you don't use Duplicate() - correct > me if I'm wrong someone! - then request.var just becomes a 'pointer' > to session.var, and session.var is still actually read when you > refer later to request.var (rendering the whole business kind of > redundant!). Duplicate() - which is only available in CF4.5+ - > makes request.var a 'deep' copy of session.var, and then request.var > technically has nothing to do with session.var except having the > same value. It's only necessary to use Duplicate in this case if Session.var is a structure or a query. If it's just a simple value, you don't need to worry - simple values are always passed by value, not by reference. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~ 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: Request Scope Questions
> Bare in mind that CF 4.5 had a um, 'issue' with Duplicate. You can > download a hotfix for it though. What was the issue?! I've got several sites live that are relying on Duplicate for passing session vars to request scope, and I'm not sure if the hosts have all the latest patches. - Gyrus ~~ 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: Request Scope Questions
as ray points out, in "principle", structcopy should be faster. by what margin, i don't know. but the principle remains. christopher olive, cto, vp of web development cresco technologies, inc 410.825.0383 http://www.crescotech.com -Original Message- From: Daniel Lancelot [mailto:[EMAIL PROTECTED]] Sent: Monday, November 12, 2001 10:32 AM To: CF-Talk Subject: FW: Request Scope Questions If this is the case, is there any disadvantage of doing duplicate rather than structcopy? - It would seem that duplicate would always work... -Original Message- From: Christopher Olive [mailto:[EMAIL PROTECTED]] Sent: 12 November 2001 15:21 To: CF-Talk Subject: RE: Request Scope Questions if i understand correctly, a week or so ago you (dave) mentioned that duplicate was only necessary for a session structure if it contained other complex variables. you said that StructCopy was sufficient if it was merely a structure with simple variables. is this correct? christopher olive, cto, vp of web development cresco technologies, inc 410.825.0383 http://www.crescotech.com -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED]] Sent: Sunday, November 11, 2001 5:00 PM To: CF-Talk Subject: RE: Request Scope Questions > A couple of notes here: if you do this, use something like > > > > to transfer the variable. If you don't use Duplicate() - correct > me if I'm wrong someone! - then request.var just becomes a 'pointer' > to session.var, and session.var is still actually read when you > refer later to request.var (rendering the whole business kind of > redundant!). Duplicate() - which is only available in CF4.5+ - > makes request.var a 'deep' copy of session.var, and then request.var > technically has nothing to do with session.var except having the > same value. It's only necessary to use Duplicate in this case if Session.var is a structure or a query. If it's just a simple value, you don't need to worry - simple values are always passed by value, not by reference. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~ 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: Request Scope Questions
I don't know if you mean me, but if so, I did not say structcopy is faster. I said it _may_ be faster, but if so, most likely not in any significant manner. (If I'm wrong, sorry. As always, listen to what I _meant_ to say, not what I said. ;) === Raymond Camden, Principal Spectra Compliance Engineer for Macromedia Email: [EMAIL PROTECTED] Yahoo IM : morpheus "My ally is the Force, and a powerful ally it is." - Yoda > -Original Message- > From: Christopher Olive [mailto:[EMAIL PROTECTED]] > Sent: Monday, November 12, 2001 10:33 AM > To: CF-Talk > Subject: RE: Request Scope Questions > > > as ray points out, in "principle", structcopy should be > faster. by what > margin, i don't know. but the principle remains. > > christopher olive, cto, vp of web development > cresco technologies, inc > 410.825.0383 > http://www.crescotech.com > > > -Original Message- > From: Daniel Lancelot [mailto:[EMAIL PROTECTED]] > Sent: Monday, November 12, 2001 10:32 AM > To: CF-Talk > Subject: FW: Request Scope Questions > > > If this is the case, is there any disadvantage of doing > duplicate rather > than structcopy? - It would seem that duplicate would > always work... > > -Original Message----- > From: Christopher Olive [mailto:[EMAIL PROTECTED]] > Sent: 12 November 2001 15:21 > To: CF-Talk > Subject: RE: Request Scope Questions > > > if i understand correctly, a week or so ago you (dave) mentioned that > duplicate was only necessary for a session structure if it contained > other complex variables. you said that StructCopy was > sufficient if it > was merely a structure with simple variables. is this correct? > > christopher olive, cto, vp of web development > cresco technologies, inc > 410.825.0383 > http://www.crescotech.com > > > -Original Message- > From: Dave Watts [mailto:[EMAIL PROTECTED]] > Sent: Sunday, November 11, 2001 5:00 PM > To: CF-Talk > Subject: RE: Request Scope Questions > > > > A couple of notes here: if you do this, use something like > > > > > > > > to transfer the variable. If you don't use Duplicate() - correct > > me if I'm wrong someone! - then request.var just becomes a 'pointer' > > to session.var, and session.var is still actually read when you > > refer later to request.var (rendering the whole business kind of > > redundant!). Duplicate() - which is only available in CF4.5+ - > > makes request.var a 'deep' copy of session.var, and then request.var > > technically has nothing to do with session.var except having the > > same value. > > It's only necessary to use Duplicate in this case if Session.var is a > structure or a query. If it's just a simple value, you don't need to > worry - > simple values are always passed by value, not by reference. > > Dave Watts, CTO, Fig Leaf Software > http://www.figleaf.com/ > voice: (202) 797-5496 > fax: (202) 797-5444 > > > > > ~~ 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: Request Scope Questions
I have never been happy with the documentation nor the general handling of by reference/by value. I think it is honestly more confusing to have certain data structures behave one way, yet others behave another. It may hide the complexity short-term but in the long run it requires cruft like the "StructCopy/ Duplicate" stuff. Point and case, Looking at the function names what is the difference in StructCopy and Duplicate. ??? You can't really tell. StructCopy creates a structure but "Top-level simple values and arrays are assigned by value". The documentation is ambiguous and probably confusing to most people. Its just funny business. In PHP I can control by reference/value with a simple ampersand and there is no language cruft really that has to work around the behavior of by reference/by value. Granted no language is perfect since some things are not very straight forward with PHP at first. One way or another, I just wish it was more concise and easy to handle in CF. All in all it is not TERRIBLE, but it certainly stands a huge amount of room for improvement. Perhaps even some diagrams and more careful wording in the documentation so that there is less ambiguity. Jeremy Allen elliptIQ Inc. -Original Message- From: Raymond Camden [mailto:[EMAIL PROTECTED]] Sent: Monday, November 12, 2001 10:40 AM To: CF-Talk Subject: RE: Request Scope Questions I don't know if you mean me, but if so, I did not say structcopy is faster. I said it _may_ be faster, but if so, most likely not in any significant manner. (If I'm wrong, sorry. As always, listen to what I _meant_ to say, not what I said. ;) === Raymond Camden, Principal Spectra Compliance Engineer for Macromedia Email: [EMAIL PROTECTED] Yahoo IM : morpheus "My ally is the Force, and a powerful ally it is." - Yoda > -Original Message- > From: Christopher Olive [mailto:[EMAIL PROTECTED]] > Sent: Monday, November 12, 2001 10:33 AM > To: CF-Talk > Subject: RE: Request Scope Questions > > > as ray points out, in "principle", structcopy should be > faster. by what > margin, i don't know. but the principle remains. > > christopher olive, cto, vp of web development > cresco technologies, inc > 410.825.0383 > http://www.crescotech.com > > > -Original Message- > From: Daniel Lancelot [mailto:[EMAIL PROTECTED]] > Sent: Monday, November 12, 2001 10:32 AM > To: CF-Talk > Subject: FW: Request Scope Questions > > > If this is the case, is there any disadvantage of doing > duplicate rather > than structcopy? - It would seem that duplicate would > always work... > > -----Original Message- > From: Christopher Olive [mailto:[EMAIL PROTECTED]] > Sent: 12 November 2001 15:21 > To: CF-Talk > Subject: RE: Request Scope Questions > > > if i understand correctly, a week or so ago you (dave) mentioned that > duplicate was only necessary for a session structure if it contained > other complex variables. you said that StructCopy was > sufficient if it > was merely a structure with simple variables. is this correct? > > christopher olive, cto, vp of web development > cresco technologies, inc > 410.825.0383 > http://www.crescotech.com > > > -Original Message- > From: Dave Watts [mailto:[EMAIL PROTECTED]] > Sent: Sunday, November 11, 2001 5:00 PM > To: CF-Talk > Subject: RE: Request Scope Questions > > > > A couple of notes here: if you do this, use something like > > > > > > > > to transfer the variable. If you don't use Duplicate() - correct > > me if I'm wrong someone! - then request.var just becomes a 'pointer' > > to session.var, and session.var is still actually read when you > > refer later to request.var (rendering the whole business kind of > > redundant!). Duplicate() - which is only available in CF4.5+ - > > makes request.var a 'deep' copy of session.var, and then request.var > > technically has nothing to do with session.var except having the > > same value. > > It's only necessary to use Duplicate in this case if Session.var is a > structure or a query. If it's just a simple value, you don't need to > worry - > simple values are always passed by value, not by reference. > > Dave Watts, CTO, Fig Leaf Software > http://www.figleaf.com/ > voice: (202) 797-5496 > fax: (202) 797-5444 > > > > > ~~ 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: Request Scope Questions
> if i understand correctly, a week or so ago you (dave) > mentioned that duplicate was only necessary for a session > structure if it contained other complex variables. you said > that StructCopy was sufficient if it was merely a structure > with simple variables. is this correct? Yes, that's correct. Personally, I just use Duplicate whenever I want to pass a structure by value, so I don't even think about it. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~ 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: Request Scope Questions
Why not just copy the pointer from the session scope to the request scope? Wouldn't the single-threaded nature of the request scope protect the actual data from corruption? I suppose the question I have is HOW does the CF server force single threading in the request scope: 1. By forcing every request into its own memory space or 2. By internally recognizing and locking the data associated with the request scope Anyone? Anyone? Bryan Love Macromedia Certified Professional Internet Application Developer / Database Analyst Telecommunication Systems Inc. [EMAIL PROTECTED] "What father would hesitate to say 'if there must be trouble let it be in my day, that my child may have peace'?" - Thomas Paine, An American Crisis -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED]] Sent: Monday, November 12, 2001 11:12 AM To: CF-Talk Subject: RE: Request Scope Questions > if i understand correctly, a week or so ago you (dave) > mentioned that duplicate was only necessary for a session > structure if it contained other complex variables. you said > that StructCopy was sufficient if it was merely a structure > with simple variables. is this correct? Yes, that's correct. Personally, I just use Duplicate whenever I want to pass a structure by value, so I don't even think about it. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~ 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: Request Scope Questions
no, i said as you pointed out, it might be faster. in principle, this seems a logical statment. christopher olive, cto, vp of web development cresco technologies, inc 410.825.0383 http://www.crescotech.com -Original Message- From: Raymond Camden [mailto:[EMAIL PROTECTED]] Sent: Monday, November 12, 2001 10:40 AM To: CF-Talk Subject: RE: Request Scope Questions I don't know if you mean me, but if so, I did not say structcopy is faster. I said it _may_ be faster, but if so, most likely not in any significant manner. (If I'm wrong, sorry. As always, listen to what I _meant_ to say, not what I said. ;) Raymond Camden, Principal Spectra Compliance Engineer for Macromedia Email: [EMAIL PROTECTED] Yahoo IM : morpheus "My ally is the Force, and a powerful ally it is." - Yoda > -Original Message- > From: Christopher Olive [mailto:[EMAIL PROTECTED]] > Sent: Monday, November 12, 2001 10:33 AM > To: CF-Talk > Subject: RE: Request Scope Questions > > > as ray points out, in "principle", structcopy should be > faster. by what > margin, i don't know. but the principle remains. > > christopher olive, cto, vp of web development > cresco technologies, inc > 410.825.0383 > http://www.crescotech.com > > > -Original Message- > From: Daniel Lancelot [mailto:[EMAIL PROTECTED]] > Sent: Monday, November 12, 2001 10:32 AM > To: CF-Talk > Subject: FW: Request Scope Questions > > > If this is the case, is there any disadvantage of doing > duplicate rather > than structcopy? - It would seem that duplicate would > always work... > > -Original Message----- > From: Christopher Olive [mailto:[EMAIL PROTECTED]] > Sent: 12 November 2001 15:21 > To: CF-Talk > Subject: RE: Request Scope Questions > > > if i understand correctly, a week or so ago you (dave) mentioned that > duplicate was only necessary for a session structure if it contained > other complex variables. you said that StructCopy was > sufficient if it > was merely a structure with simple variables. is this correct? > > christopher olive, cto, vp of web development > cresco technologies, inc > 410.825.0383 > http://www.crescotech.com > > > -Original Message- > From: Dave Watts [mailto:[EMAIL PROTECTED]] > Sent: Sunday, November 11, 2001 5:00 PM > To: CF-Talk > Subject: RE: Request Scope Questions > > > > A couple of notes here: if you do this, use something like > > > > > > > > to transfer the variable. If you don't use Duplicate() - correct > > me if I'm wrong someone! - then request.var just becomes a 'pointer' > > to session.var, and session.var is still actually read when you > > refer later to request.var (rendering the whole business kind of > > redundant!). Duplicate() - which is only available in CF4.5+ - > > makes request.var a 'deep' copy of session.var, and then request.var > > technically has nothing to do with session.var except having the > > same value. > > It's only necessary to use Duplicate in this case if Session.var is a > structure or a query. If it's just a simple value, you don't need to > worry - > simple values are always passed by value, not by reference. > > Dave Watts, CTO, Fig Leaf Software > http://www.figleaf.com/ > voice: (202) 797-5496 > fax: (202) 797-5444 > > > > > ~~ 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: Request Scope Questions
Well, the 'issue' (to put it mildly) that we experienced appeared to be one of memory corruption. We got inconsistent, very vague error messages, sometimes referencing variable names from another application on the same server. The problems were very persistent, so if you haven't been having problems already, you might be safe. Unfortunately the patch is only for CF Enterprise (we have Professional), so I resorted to copying all individual structure keys to Request scope, and locking Session scoped queries before looping throught them. Marianne Daye -Original Message- From: gyrus [mailto:[EMAIL PROTECTED]] Sent: Monday, November 12, 2001 10:32 AM To: CF-Talk Subject: Re: Request Scope Questions > Bare in mind that CF 4.5 had a um, 'issue' with Duplicate. You can > download a hotfix for it though. What was the issue?! I've got several sites live that are relying on Duplicate for passing session vars to request scope, and I'm not sure if the hosts have all the latest patches. - Gyrus ~~ 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: Request Scope Questions
Which is not surprising. The issue was that Duplicate was not creating a true copy under certain situations. Instead it was creating pointers. This then would cause problems just like using app/session/server vars w/o locking, as Marianne describes below. I don't remember the exact situation where Duplicate failed. I believe it was different from where StructCopy failed. If I remember right it was something pretty deep - like a struct having an array that had structs itself. Eitherway, if you are running 4.5, just get the hot fix. === Raymond Camden, Principal Spectra Compliance Engineer for Macromedia Email: [EMAIL PROTECTED] Yahoo IM : morpheus "My ally is the Force, and a powerful ally it is." - Yoda > -Original Message- > From: Daye, Marianne [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, November 13, 2001 7:45 AM > To: CF-Talk > Subject: RE: Request Scope Questions > > > Well, the 'issue' (to put it mildly) that we experienced > appeared to be one > of memory corruption. We got inconsistent, very vague error messages, > sometimes referencing variable names from another application > on the same > server. The problems were very persistent, so if you haven't > been having > problems already, you might be safe. Unfortunately the patch > is only for CF > Enterprise (we have Professional), so I resorted to copying > all individual > structure keys to Request scope, and locking Session scoped > queries before > looping throught them. > > Marianne Daye > > -Original Message- > From: gyrus [mailto:[EMAIL PROTECTED]] > Sent: Monday, November 12, 2001 10:32 AM > To: CF-Talk > Subject: Re: Request Scope Questions > > > > Bare in mind that CF 4.5 had a um, 'issue' with > Duplicate. You can > > download a hotfix for it though. > > What was the issue?! I've got several sites live that are relying > on Duplicate for passing session vars to request scope, and > I'm not sure if the hosts have all the latest patches. > > - Gyrus > > > > ~~ 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: Request Scope Questions
> I don't remember the exact situation where Duplicate failed. I believe > it was different from where StructCopy failed. If I remember right it > was something pretty deep - like a struct having an array that had > structs itself. Eitherway, if you are running 4.5, just get > the hot fix. We had it when we had created queries in shared scope vars (session/application etc) and then tried to duplicate them. Blew up every time, taking the server with it. > -Original Message- > From: Raymond Camden [mailto:[EMAIL PROTECTED]] > Sent: 13 November 2001 13:53 > To: CF-Talk > Subject: RE: Request Scope Questions > > > Which is not surprising. The issue was that Duplicate was not > creating a > true copy under certain situations. Instead it was creating pointers. > This then would cause problems just like using app/session/server vars > w/o locking, as Marianne describes below. > > I don't remember the exact situation where Duplicate failed. I believe > it was different from where StructCopy failed. If I remember right it > was something pretty deep - like a struct having an array that had > structs itself. Eitherway, if you are running 4.5, just get > the hot fix. > > == > = > Raymond Camden, Principal Spectra Compliance Engineer for Macromedia > > Email: [EMAIL PROTECTED] > Yahoo IM : morpheus > > "My ally is the Force, and a powerful ally it is." - Yoda > > > -Original Message- > > From: Daye, Marianne [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, November 13, 2001 7:45 AM > > To: CF-Talk > > Subject: RE: Request Scope Questions > > > > > > Well, the 'issue' (to put it mildly) that we experienced > > appeared to be one > > of memory corruption. We got inconsistent, very vague > error messages, > > sometimes referencing variable names from another application > > on the same > > server. The problems were very persistent, so if you haven't > > been having > > problems already, you might be safe. Unfortunately the patch > > is only for CF > > Enterprise (we have Professional), so I resorted to copying > > all individual > > structure keys to Request scope, and locking Session scoped > > queries before > > looping throught them. > > > > Marianne Daye > > > > -Original Message- > > From: gyrus [mailto:[EMAIL PROTECTED]] > > Sent: Monday, November 12, 2001 10:32 AM > > To: CF-Talk > > Subject: Re: Request Scope Questions > > > > > > > Bare in mind that CF 4.5 had a um, 'issue' with > > Duplicate. You can > > > download a hotfix for it though. > > > > What was the issue?! I've got several sites live that are relying > > on Duplicate for passing session vars to request scope, and > > I'm not sure if the hosts have all the latest patches. > > > > - Gyrus > > > > > > > > > ~~ 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: request scope revisted
I use request scopes for most of my page level data, ie. mapping names, paths, dsns, site name, contact emails, etc.. I also duplicate most of the session vars into a request structure and use them throughout the app to get around the infamous CFLOCK problems.. Darryl -Original Message- From: Won Lee [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 11, 2001 8:44 AM To: CF-Talk Subject: request scope revisted Anyone out there set a request.dsn instead of an application.dsn? If so is there an advantage? Won ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: request scope revisted
All my DSNs are request-scope. Advantage: No locking needed. best, paul At 05:44 PM 1/10/01 -0500, you wrote: >Anyone out there set a request.dsn instead of an application.dsn? >If so is there an advantage? ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: request scope revisted
> Anyone out there set a request.dsn instead of an application.dsn? > If so is there an advantage? OK, answering the actual question; The main advantage is that Request doesn't need an Application to be defined, while (suprisingly) the Application scope does The Request scope quickly allows you to use variables through all custom tags called by CF_ without having to pass the variables directly or use Caller (which gets difficult with recursive templates) Philip Arnold Director Certified ColdFusion Developer ASP Multimedia Limited T: +44 (0)20 8680 1133 "Websites for the real world" ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: request scope revisted
Anyone using fusebox uses the request.dsn (or .datasource). It can be done either way and as far as I am concerned, there isnt an advantage/disadvantage to either way. --=@ greg @=-- - Original Message - From: "Won Lee" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Wednesday, January 10, 2001 5:44 PM Subject: request scope revisted > Anyone out there set a request.dsn instead of an application.dsn? > If so is there an advantage? > > Won > > ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: request scope revisted
At 10:07 1/11/01 -0500, you wrote: >Anyone using fusebox uses the request.dsn (or .datasource). It can be done >either way and as far as I am concerned, there isnt an >advantage/disadvantage to either way. If you use the application scope you always have to use CFLOCK to read and write to it. A slight pain, a big pain if a developer forgets to use the lock. The request scope does not have this requirement, it needs no locking. RPS ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: request scope revisted
Hmm my thinking is this... If you put in an application scope the CF Server has to open up a new thread for each application variable and you need to lock it. If you put it in the request scope in the Application.cfm you don't have use CFLOCK. However if you put it in the request scope you will be re-setting all the variables on every single page call. Let's say you have like 50 application variables, now you will be loading in these variables every single time. The application variables were loaded only once per timeout. Which one is really the advantage? Won -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 11, 2001 2:02 AM To: CF-Talk Subject: Re: request scope revisted All my DSNs are request-scope. Advantage: No locking needed. best, paul At 05:44 PM 1/10/01 -0500, you wrote: >Anyone out there set a request.dsn instead of an application.dsn? >If so is there an advantage? ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
structure in request scope
I have just failed to find that code for a structure in the request scope in the cf-talk archive. Can someone point me to it please? Thanks ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
structure in request scope
Could someone tell me how to load a structure into the request scope in the application.cfm once only when a user first visits a page. That is, check that the structure is there and dont rerun the query code if it is unless a change has been made to the database. Its for the colour scheme of a site. Thanks ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: request scope confusion
> -Original Message- > From: sebastian palmigiani [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, May 29, 2001 12:01 PM > To: CF-Talk > Subject: request scope confusion > > > > I am trying to understand the request scope. > > What is the difference between putting > > > > vs. > > cfset request.DSN = 'foo'> > > in the application.cfm template or in any template? When you set a without a scope, it is put in the "VARIABLES" scope, which can only be accessed by the current page after it has been set, as well as in any cfincludes you might have in that page, that come afterwards. Using the request scope is basically the same thing, since the variable will still be lost after the current page is processed, EXCEPT variables in the request scope are accessible within custom tags, whereas regular variables are not. Note that scoped variables such as SERVER, APPLICATION, SESSION, FORM, URL and ATTRIBUTES are available within custom tags as well. So to clarify and relate to your question, setting a variable with the request scope in your application.cfm is different in that all pages and called tags will have access to that variable (provided you read/write it as REQUEST.DSN), whereas only the current page being processed would be able to read the variable DSN. Custom tags have a separate memory space allocated to them, but the aforementioned scopes are accessible to the called tag even though they are outside the memory space of the custom tag. -Andy ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: RE: Request Scope
Spectra uses the request scope extensively. It's a good place to put thread-safe global variables. What you've heard about eliminating the need for session, and application locks is true. You can copy all your session and application variables to the request scope and not need to use CFLOCK around each call to these variables. You would do something like this: This code would go in your application.cfm file so those variables get copied every time someone requests a page. You CANNOT use: In most languages, including ColdFusion, when you set a variable equal to a complex data set (like a structure, query, array, etc.), it will create a reference back to the complex data set. In other words, it's just creating a pointer to the original data in the session or application scope, so you're still not thread safe. Using the duplicate() function will make a complete copy of those structures (the session and application scopes are ColdFusion structures) into the request scope and you will be accessing the copied data, not the original data in in the shared scope. HTH, Jason Jason Aden Allaire Certified Developer [EMAIL PROTECTED] www.wwstudios.com > -Original Message- > From: Carol Bluestein [mailto:[EMAIL PROTECTED]] > Sent: Friday, February 02, 2001 10:25 AM > To: CF-Talk > Subject: Re:RE: Request Scope > > > Is any one out there using the request variables extensively? > > I'd like to know more about the request scope and how to use it. > I've found > very little in my documentation (4.0.1) and have searched the > allaire knowledge > base with no obvious results (a lot comes up but the titles lead > me to believe > they were not pertinent). I've heard that using request scope > variables can > help limit the "need" for session and/or application variables so that the > necessity of locking is minimized and in some cases eliminated. > I also admit > that I could have heard this out of context. > > Any clarification and information would be appreciated. > > Thanks, in advance, > Carol > > > Carol L. Bluestein > Senior Programmer > NYS Office of Real Property > 518-486-6335 > [EMAIL PROTECTED] > > > ____________Reply Separator > Subject:RE: Request Scope > Author: [EMAIL PROTECTED] > Date: 2/1/01 8:06 PM > > > The "Request" scope was available in CF 4.0 wasn't it? > > Yup, just tested on our 4.0.1 server and it worked perfectly > > Philip Arnold > Director > Certified ColdFusion Developer > ASP Multimedia Limited > T: +44 (0)20 8680 1133 > > "Websites for the real world" > > ** > This email and any files transmitted with it are confidential and > intended solely for the use of the individual or entity to whom they > are addressed. If you have received this email in error please notify > the system manager. > ** > ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: RE: Request Scope
i tend to user REQUEST variables for things that are "constants" in an application/page. for example, DSNs, Title Text, and other things that tend not to change value over the life of an application. by making them request variables, you can still have the "change them in one place" ability (usually the application.cfm), but you do not have to worry about locking. chris olive, cio cresco technologies [EMAIL PROTECTED] http://www.crescotech.com -Original Message- From: Carol Bluestein [mailto:[EMAIL PROTECTED]] Sent: Friday, February 02, 2001 10:25 AM To: CF-Talk Subject: Re:RE: Request Scope Is any one out there using the request variables extensively? I'd like to know more about the request scope and how to use it. I've found very little in my documentation (4.0.1) and have searched the allaire knowledge base with no obvious results (a lot comes up but the titles lead me to believe they were not pertinent). I've heard that using request scope variables can help limit the "need" for session and/or application variables so that the necessity of locking is minimized and in some cases eliminated. I also admit that I could have heard this out of context. Any clarification and information would be appreciated. Thanks, in advance, Carol Carol L. Bluestein Senior Programmer NYS Office of Real Property 518-486-6335 [EMAIL PROTECTED] Reply Separator____ Subject:RE: Request Scope Author: [EMAIL PROTECTED] Date: 2/1/01 8:06 PM > The "Request" scope was available in CF 4.0 wasn't it? Yup, just tested on our 4.0.1 server and it worked perfectly Philip Arnold Director Certified ColdFusion Developer ASP Multimedia Limited T: +44 (0)20 8680 1133 "Websites for the real world" ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re:RE: RE: Request Scope
Jason, Thank you. Thank you. Thank you. That makes so much more sense. May I trouble you one more time for the code, and I'm sure this is showing some kind of difficulty on my part understanding complex structures: Do I set this code for EACH session and application variable or does the code cover all session/application variables ? OR Depending on the above, how do I reference the request variable in a code? Thanks again, Carol This will make like so much easier. Carol L. Bluestein Senior Programmer NYS Office of Real Property 518-486-6335 [EMAIL PROTECTED] Reply Separator Subject:RE: RE: Request Scope Author: [EMAIL PROTECTED] Date: 2/2/01 11:30 AM Spectra uses the request scope extensively. It's a good place to put thread-safe global variables. What you've heard about eliminating the need for session, and application locks is true. You can copy all your session and application variables to the request scope and not need to use CFLOCK around each call to these variables. You would do something like this: This code would go in your application.cfm file so those variables get copied every time someone requests a page. You CANNOT use: In most languages, including ColdFusion, when you set a variable equal to a complex data set (like a structure, query, array, etc.), it will create a reference back to the complex data set. In other words, it's just creating a pointer to the original data in the session or application scope, so you're still not thread safe. Using the duplicate() function will make a complete copy of those structures (the session and application scopes are ColdFusion structures) into the request scope and you will be accessing the copied data, not the original data in in the shared scope. HTH, Jason Jason Aden Allaire Certified Developer [EMAIL PROTECTED] www.wwstudios.com > -Original Message- > From: Carol Bluestein [mailto:[EMAIL PROTECTED]] > Sent: Friday, February 02, 2001 10:25 AM > To: CF-Talk > Subject: Re:RE: Request Scope > > > Is any one out there using the request variables extensively? > > I'd like to know more about the request scope and how to use it. > I've found > very little in my documentation (4.0.1) and have searched the > allaire knowledge > base with no obvious results (a lot comes up but the titles lead > me to believe > they were not pertinent). I've heard that using request scope > variables can > help limit the "need" for session and/or application variables so that the > necessity of locking is minimized and in some cases eliminated. > I also admit > that I could have heard this out of context. > > Any clarification and information would be appreciated. > > Thanks, in advance, > Carol > > > Carol L. Bluestein > Senior Programmer > NYS Office of Real Property > 518-486-6335 > [EMAIL PROTECTED] > > > ____Reply Separator > Subject:RE: Request Scope > Author: [EMAIL PROTECTED] > Date: 2/1/01 8:06 PM > > > The "Request" scope was available in CF 4.0 wasn't it? > > Yup, just tested on our 4.0.1 server and it worked perfectly > > Philip Arnold > Director > Certified ColdFusion Developer > ASP Multimedia Limited > T: +44 (0)20 8680 1133 > > "Websites for the real world" > > ** > This email and any files transmitted with it are confidential and > intended solely for the use of the individual or entity to whom they > are addressed. If you have received this email in error please notify > the system manager. > ** > ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: RE: Request Scope
> Is any one out there using the request variables extensively? > > I'd like to know more about the request scope and how to use it. > I've found > very little in my documentation (4.0.1) and have searched the > allaire knowledge > base with no obvious results (a lot comes up but the titles lead > me to believe > they were not pertinent). I've heard that using request scope > variables can > help limit the "need" for session and/or application variables so that the > necessity of locking is minimized and in some cases eliminated. > I also admit > that I could have heard this out of context. > > Any clarification and information would be appreciated. The biggest use for the Request scope I have found is for using variables in the main template and in CF_ tags or CFModule calls Anything in the Request scope is visible from any CF code on the same template Philip Arnold Director Certified ColdFusion Developer ASP Multimedia Limited T: +44 (0)20 8680 1133 "Websites for the real world" ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: RE: Request Scope
The request scope is helpful as a kind of global constant since it exists as a global variable. This helps particularly when you are nesting custom tags and don't want to get bogged down with #caller.caller.variables# Beware though that its possible to over-write a request variable from separate templates - they can't be locked AFAIK. Some fusebox apps use request scope a lot BTW Tristram Charnley - [EMAIL PROTECTED] "If something is hard to do, its not worth doing!" Homer Simpson. -Original Message- From: Carol Bluestein [mailto:[EMAIL PROTECTED]] Sent: 02 February 2001 15:25 To: CF-Talk Subject: Re:RE: Request Scope Is any one out there using the request variables extensively? I'd like to know more about the request scope and how to use it. I've found very little in my documentation (4.0.1) and have searched the allaire knowledge base with no obvious results (a lot comes up but the titles lead me to believe they were not pertinent). I've heard that using request scope variables can help limit the "need" for session and/or application variables so that the necessity of locking is minimized and in some cases eliminated. I also admit that I could have heard this out of context. Any clarification and information would be appreciated. Thanks, in advance, Carol Carol L. Bluestein Senior Programmer NYS Office of Real Property 518-486-6335 [EMAIL PROTECTED] Reply Separator____ Subject:RE: Request Scope Author: [EMAIL PROTECTED] Date: 2/1/01 8:06 PM > The "Request" scope was available in CF 4.0 wasn't it? Yup, just tested on our 4.0.1 server and it worked perfectly Philip Arnold Director Certified ColdFusion Developer ASP Multimedia Limited T: +44 (0)20 8680 1133 "Websites for the real world" ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists