RE: STICKY Application.datasource
You can most certainly store the datasource in an application variable. Assuming you have a whole bunch of app vars that you will be using throughout your application. Andrew is correct in what he is saying about using request scope as you don't need to lock the application scope EVERY time you want to use it. Instead you can use something like:- cflock scope=APPLICATION type=READONLY timeout=10 throwontimeout=Yes cfset Request.Application = duplicate(Application) /cflock Martin Parry Macromedia Certified Developer http://www.BeetrootStreet.co.uk -Original Message- From: Andrew Grosset [mailto:[EMAIL PROTECTED] Sent: 29 December 2004 05:16 To: CF-Talk Subject: Re: STICKY Application.datasource Unless it's really necessary I would try not to set datasource as an application variable, either: cfset datasource=CODAGenomics or cfset request.datasource=CODAGenomics Andrew. ~| Special thanks to the CF Community Suite Silver Sponsor - CFDynamics http://www.cfdynamics.com Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188919 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: STICKY Application.datasource
Since the advent of CFMX 6.1, the Macromedia specs state (no time to find a URL, it's moving day 3) that shared-scope variables that will be set once and contain a static value (i.e. static data available to the entire app... like a DSN) do not need to be locked. Race conditions and deadlocks were eliminated, so the only reason to use a lock is to prevent data corruption... as long as your DSN isn't going to change there isn't a reason to lock it. At least according (I believe this is where it is) the LiveDoc for the cflock tag under 6.1. Also, even tho I'm sure this has already been stated, setting an application variable in a cfparam tag is a fine idea, but changing the default isn't going to change the value until you've deleted the original... because application variables are persistent, and because the cfparam tag doesn't fire to create the var unless it doesn't already exists, the only way to change the value is either to delete it... or, something I've done often is to put a cfif in application.cfm that looks for a URL variable to fire off some CFSETs: cfif isDefined(URL.reloadAppScope) cflock scope=application type=exclusive timeout=20 cfset application.appVar1 = 1 {more cfset tags to write your app vars} /cflock /cfif And that's my own two cents... Laterz, J -- Continuum Media Group LLC Burnsville, MN 55337 http://www.web-relevant.com On Wed, 29 Dec 2004 09:50:30 -, Martin Parry [EMAIL PROTECTED] wrote: You can most certainly store the datasource in an application variable. Assuming you have a whole bunch of app vars that you will be using throughout your application. Andrew is correct in what he is saying about using request scope as you don't need to lock the application scope EVERY time you want to use it. Instead you can use something like:- cflock scope=APPLICATION type=READONLY timeout=10 throwontimeout=Yes cfset Request.Application = duplicate(Application) /cflock Martin Parry Macromedia Certified Developer http://www.BeetrootStreet.co.uk -Original Message- From: Andrew Grosset [mailto:[EMAIL PROTECTED] Sent: 29 December 2004 05:16 To: CF-Talk Subject: Re: STICKY Application.datasource Unless it's really necessary I would try not to set datasource as an application variable, either: cfset datasource=CODAGenomics or cfset request.datasource=CODAGenomics Andrew. ~| Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net http://www.cfhosting.net Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188932 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: STICKY Application.datasource
Assuming you have a whole bunch of app vars that you will be using throughout your application. Andrew is correct in what he is saying about using request scope as you don't need to lock the application scope EVERY time you want to use it. Instead you can use something like:- cflock scope=APPLICATION type=READONLY timeout=10 throwontimeout=Yes cfset Request.Application = duplicate(Application) /cflock While you can do this, in my experience this causes a terrible performance degradation in applications with moderate or heavy use. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ phone: 202-797-5496 fax: 202-797-5444 ~| Special thanks to the CF Community Suite Silver Sponsor - CFDynamics http://www.cfdynamics.com Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188939 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: STICKY Application.datasource
Unless it's really necessary I would try not to set datasource as an application variable, either: cfset datasource=CODAGenomics or cfset request.datasource=CODAGenomics In general, I agree with this. If the value of a variable won't change during the operation of an application and the variable contains a simple value, there's little value in storing it persistently beyond a single page request, since there's very little cost involved in simply recreating it on every page request as needed. However, if you're using CFMX it really doesn't make any significant difference one way or the other, and even with previous versions it usually didn't as long as you were careful to create the variable once but never write to it again. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ phone: 202-797-5496 fax: 202-797-5444 ~| Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net http://www.cfhosting.net Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188943 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: STICKY Application.datasource
This is kind of dangerous unless you use cflocks properly, and cflocking the application scope can slow things down. The reason is if somewhere in your app you change the application.datsource from CODAGenomics to something else, which you've indicated happens, any other user loading a page will change it right back to CODAGenomics. Well, that worked, TNX very much. When is cfparam appropriate?? -Original Message- From: Qasim Rasheed [mailto:[EMAIL PROTECTED] Sent: Monday, December 27, 2004 7:30 PM To: CF-Talk Subject: Re: STICKY Application.datasource Instead of this cfparam name=Application.datasource default=CODAGenomics use this cfset Application.datasource = CODAGenomics On Mon, 27 Dec 2004 19:12:36 -0800, Richard Colman [EMAIL PROTECTED] wrote: ~| Special thanks to the CF Community Suite Silver Sponsor - RUWebby http://www.ruwebby.com Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188901 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: STICKY Application.datasource
Not sure what that has to do with locks. Nothing at all as far as I can tell. I'd hope the entire application uses the same datasource. If you need a second one, just set application.otherdb = 'whatever' -Cameron On Tue, 28 Dec 2004 16:27:35 -0400, Larry White [EMAIL PROTECTED] wrote: This is kind of dangerous unless you use cflocks properly, and cflocking the application scope can slow things down. The reason is if somewhere in your app you change the application.datsource from CODAGenomics to something else, which you've indicated happens, any other user loading a page will change it right back to CODAGenomics. Well, that worked, TNX very much. When is cfparam appropriate?? -Original Message- From: Qasim Rasheed [mailto:[EMAIL PROTECTED] Sent: Monday, December 27, 2004 7:30 PM To: CF-Talk Subject: Re: STICKY Application.datasource Instead of this cfparam name=Application.datasource default=CODAGenomics use this cfset Application.datasource = CODAGenomics On Mon, 27 Dec 2004 19:12:36 -0800, Richard Colman [EMAIL PROTECTED] wrote: ~| Special thanks to the CF Community Suite Silver Sponsor - CFDynamics http://www.cfdynamics.com Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188909 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: STICKY Application.datasource
Unless it's really necessary I would try not to set datasource as an application variable, either: cfset datasource=CODAGenomics or cfset request.datasource=CODAGenomics Andrew. I seem to have a sticky application variable. How do I get it to change? The application.cfm file is: cfapplication name=CBRLVer11 sessionmanagement=Yes clientmanagement=Yes SESSIONTIMEOUT=#CREATETIMESPAN(0,8,0,0)# cfparam name=Application.datasource default=CODAGenomics cfparam name=Application.name default=CODA All the queries use: cfquery datasource=#application.datasource# name=xxx So, when I changed the application.datasource default value, the related scripts Still bring up the old value. Have tried clearing the browser cache, etc. etc. Any idea why and how to fix? TNX if you can shed some light on this problem. Rick. ~| Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net http://www.cfhosting.net Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188918 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: STICKY Application.datasource
Instead of this cfparam name=Application.datasource default=CODAGenomics use this cfset Application.datasource = CODAGenomics On Mon, 27 Dec 2004 19:12:36 -0800, Richard Colman [EMAIL PROTECTED] wrote: I seem to have a sticky application variable. How do I get it to change? The application.cfm file is: cfapplication name=CBRLVer11 sessionmanagement=Yes clientmanagement=Yes SESSIONTIMEOUT=#CREATETIMESPAN(0,8,0,0)# cfparam name=Application.datasource default=CODAGenomics cfparam name=Application.name default=CODA All the queries use: cfquery datasource=#application.datasource# name=xxx So, when I changed the application.datasource default value, the related scripts Still bring up the old value. Have tried clearing the browser cache, etc. etc. Any idea why and how to fix? TNX if you can shed some light on this problem. Rick. ~| Special thanks to the CF Community Suite Silver Sponsor - CFDynamics http://www.cfdynamics.com Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188839 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: STICKY Application.datasource
Well, that worked, TNX very much. When is cfparam appropriate?? -Original Message- From: Qasim Rasheed [mailto:[EMAIL PROTECTED] Sent: Monday, December 27, 2004 7:30 PM To: CF-Talk Subject: Re: STICKY Application.datasource Instead of this cfparam name=Application.datasource default=CODAGenomics use this cfset Application.datasource = CODAGenomics On Mon, 27 Dec 2004 19:12:36 -0800, Richard Colman [EMAIL PROTECTED] wrote: I seem to have a sticky application variable. How do I get it to change? The application.cfm file is: cfapplication name=CBRLVer11 sessionmanagement=Yes clientmanagement=Yes SESSIONTIMEOUT=#CREATETIMESPAN(0,8,0,0)# cfparam name=Application.datasource default=CODAGenomics cfparam name=Application.name default=CODA All the queries use: cfquery datasource=#application.datasource# name=xxx So, when I changed the application.datasource default value, the related scripts Still bring up the old value. Have tried clearing the browser cache, etc. etc. Any idea why and how to fix? TNX if you can shed some light on this problem. Rick. ~| Special thanks to the CF Community Suite Silver Sponsor - RUWebby http://www.ruwebby.com Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188843 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: STICKY Application.datasource
cfparam is equivilant to cfif not isDefined('application.datasource') cfset application.datasource = 'myDatasource' /cfif -Cameron On Mon, 27 Dec 2004 20:25:33 -0800, Richard Colman [EMAIL PROTECTED] wrote: Well, that worked, TNX very much. When is cfparam appropriate?? -Original Message- From: Qasim Rasheed [mailto:[EMAIL PROTECTED] Sent: Monday, December 27, 2004 7:30 PM To: CF-Talk Subject: Re: STICKY Application.datasource Instead of this cfparam name=Application.datasource default=CODAGenomics use this cfset Application.datasource = CODAGenomics On Mon, 27 Dec 2004 19:12:36 -0800, Richard Colman [EMAIL PROTECTED] wrote: I seem to have a sticky application variable. How do I get it to change? The application.cfm file is: cfapplication name=CBRLVer11 sessionmanagement=Yes clientmanagement=Yes SESSIONTIMEOUT=#CREATETIMESPAN(0,8,0,0)# cfparam name=Application.datasource default=CODAGenomics cfparam name=Application.name default=CODA All the queries use: cfquery datasource=#application.datasource# name=xxx So, when I changed the application.datasource default value, the related scripts Still bring up the old value. Have tried clearing the browser cache, etc. etc. Any idea why and how to fix? TNX if you can shed some light on this problem. Rick. ~| Special thanks to the CF Community Suite Silver Sponsor - CFDynamics http://www.cfdynamics.com Message: http://www.houseoffusion.com/lists.cfm/link=i:4:188844 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