Additionally, you can take a look at this blog post for a better understanding
of why you need to var a variable.
http://www.schierberl.com/cfblog/index.cfm/2008/7/21/Thread-safety-and-the-var-scope--live-example
This little tool can help you find what variables need to be put into
the var
: Application Scope Problem
Completely agree with Brad. Also wouldn't hurt to ensure that the
arguments parameters aren't sticky, by referencing the scope of 'language'
and 'placeholder' as appropriate.
cffunction access=public name=lookup returntype=string output=no
hint=Returns the text
: Application Scope Problem
It has nothing to do with Application scope and everything to do with poorly
written code, sorry to be blunt but that's the issue. As was said all
variables you that you want to be local to that method need to be var'ed.
Currently you are not doing this so those
don't worry
about the bluntness, heh, I didn't write this code, I just inherited it. :)
Paul
-Original Message-
From: Adam Haskell [mailto:a.hask...@gmail.com]
Sent: Friday, June 19, 2009 2:55 PM
To: cf-talk
Subject: Re: Application Scope Problem
It has nothing to do
Thanks!
-Original Message-
From: Jason Fisher [mailto:ja...@wanax.com]
Sent: Wednesday, June 17, 2009 3:42 PM
To: cf-talk
Subject: RE: Application Scope Problem
Completely agree with Brad. Also wouldn't hurt to ensure that the
arguments parameters aren't sticky, by referencing
Thanks!
-Original Message-
From: Jason Fisher [mailto:ja...@wanax.com]
Sent: Wednesday, June 17, 2009 3:42 PM
To: cf-talk
Subject: RE: Application Scope Problem
Completely agree with Brad. Also wouldn't hurt to ensure that the
arguments parameters aren't sticky, by referencing
: RE: Application Scope Problem
Has anyone else experienced this issue before with the application
scope? So if I ripped this out of the application scope you think it the
issue I am having would be fixed correct?
Also, please explain what you mean by ensuring that the arguments
parameters aren't
How are you setting the component in the app scope?
-Original Message-
From: Dawson, Michael [mailto:m...@evansville.edu]
Sent: 18 June 2009 14:20
To: cf-talk
Subject: RE: Application Scope Problem
We have had instances where a component, stored in the application
scope, could
Sticky, meaning that a variable holds the same value across multiple
calls, because it's in the application scope, and therefore shared across
all users of that application.
The 'arguments' scope should be used within the body of the function, not
the CFARGUMENT tag. So, this is fine:
est.current_lang)#
/cfoutput
!--- End Usage ---
-Original Message-
From: Adrian Lynch [mailto:cont...@adrianlynch.co.uk]
Sent: Thursday, June 18, 2009 9:43 AM
To: cf-talk
Subject: RE: Application Scope Problem
How are you setting the component in the app scope
[mailto:paulalkemadesi...@gmail.com]
Sent: 18 June 2009 14:53
To: cf-talk
Subject: RE: Application Scope Problem
Code Example
!--- Start set application in scope ---
cfset
application.translator=createObject(component,'packages.translator.tr
ansla
tor')
!--- End set application in scope
with component instantiation because this works 99%
of the time, but fails without any explanation.
Thanks,
Mike
-Original Message-
From: Adrian Lynch [mailto:cont...@adrianlynch.co.uk]
Sent: Thursday, June 18, 2009 8:43 AM
To: cf-talk
Subject: RE: Application Scope Problem
How are you setting
Hey guys,
The company I work for has a ColdFusion function that's being stored in the
application scope.
This function is used to pull translated text which changes based off of the
users current country that they selected. An issue we've been having however
is that on occasions we will run
Do you think this could have anything to do with the fact that this
function
is being stored in the application scope?
===
Yes, it has everything to do with that. You need to var EVERY variable
used in that function. Otherwise it is shared by everyone calling your
code at the exact same
/cfif
cfreturn temptext
/cffunction
From: b...@bradwood.com
Sent: Wednesday, June 17, 2009 3:38 PM
To: cf-talk cf-talk@houseoffusion.com
Subject: RE: Application Scope Problem
Do you think this could have anything to do with the fact
Hi guys,
I think I'm getting a corrupt application scope problem.
The CF error is:
The element at position 3 cannot be found. LINE 411
LINE 411 is:
#application.rews.timePeriods[X].name# (it's in a loop so X would have
been equal to 3).
Application.cfm code
Matthew Chambers wrote:
application.rews.timePeriods[1] = StructNew();
You might try using :
arrayAppend(application.rews.timePeriods, structNew());
Or... create the struct first... ie
tmpStruct = structNew()
tmpStruct.xxx = val;
It's also worth asking if you're doing this on EVERY page load or only
on application initilization.. ie...
cfscript
if (not isDefined(application.rews) {
// set vars here
}
/cfscript
~|
18 matches
Mail list logo