John

I am not too sure on the domain front but the application variables
will persist on a per server basis as far as I am aware, so depending
on the data you are putting in to the application scope there is the
potential for it to be different on different servers (if for example
you are setting the variable from a query result the results could be
different depending on when the application variable times out and
gets reset - but you have some control over this by using the
application timeout setting).

It may be that you need to set different application variable values
depending on which server is being used, in which case this should
work ok for you

Application scoped variables are stored in the specific server's RAM

Having said all of this, to quote O'Reilly's reference on this:

"You should note that application variables shouldn't be used within a
clustered environment, as they are stored in the RAM of a single
ColdFusion server and may not be available to other servers within the
cluster. The exception to this is in the case of session-aware or
"sticky" clusters. "

I would say that if you are setting variables such as dsns you are ok
with application scope. Another point to note is that this will get
set with every page request so you may want to include the use of
isDefined to only reset it when it has been timedout and does not
exist



On 11/9/06, John Cox <[EMAIL PROTECTED]> wrote:
> I realize this is a bit of a newb question, but I am trying to get my head
> around application variables.  I come from a PHP background where I am used
> to setting configurations files, etc, which is similar to application vars,
> but not quite the same.
>
> Here's the problem I am trying to overcome.  I have several applications
> that will be reused on multiple domains.  Each of these applications have
> certain configuration that I want to set based on the domain that they are
> sitting on.  For instance, (real bad example probably) on one of my Europe
> domains I might want to set the time notation than I do in my US domains.  I
> also might be looking at a different DSN, etc, so on and so forth.  In PHP,
> I would just create a configuration based on the site, load that in, and
> presto, have my vars available.  I am a believer in using the tools
> available and not trying to rewrite the language to suit my needs, but
> rather try to rewrite my applications based on the language.
>
> In ColdFusion, we have application vars, which to me seem to me to be very
> similar if not better.  However, what I don't quite understand is the
> persistance of these vars.  Are they by domain?  Are they server wide?  I am
> pretty sure by my reading that are based on the application name, but then
> again, I have a short attention span so forgive me in advance if I am
> incorrect.  I am sure that I would need to condition the vars based on
> domain, or various other conditions, but will these vars overwrite one
> another when the application is loaded on two separate domains, or are they
> separate instances?
>
> Thanks in advance!
>
> jc
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:259762
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to