From the LiveDocs
(http://livedocs.macromedia.com/coldfusion/7/htmldocs/0696.htm)
Use this method for application initialization code; for example, use
it to set Application scope variables, to determine whether a required
data source or other resource is available, or to log the application
Michael Dinowitz said:
I'm about to do some tests on application.cfc as it deals with the
onApplicationStart and onSessionStart. The question is, if the
application/session does not exist, does the method 'lock' and
single thread the request to it or can multiple requests cause the
start
And the answer is that the onApplicationStart method singlethreads the
application until it's done. My test was to have 2 different directories
with application.cfc of the same name in them. The first had a wait function
set to a minute. The second had nothing. I ran the first and then the
Always a good idea to test the docs, especially when you have an article on
it in the upcoming print edition of the Fusion Authority Quarterly Update.
From the LiveDocs
(http://livedocs.macromedia.com/coldfusion/7/htmldocs/0696.htm)
Use this method for application initialization code;
I'll have to test that as it sounds logical but doesn't 'feel' right. Your
probably totally correct, but
Sessions and applications are entirely different beasts here. For both
the starting point is the part of the manual James referred to. But
for sessions there is an additional
: Re: Application.cfc racing
Always a good idea to test the docs, especially when you have an article on
it in the upcoming print edition of the Fusion Authority Quarterly Update.
From the LiveDocs
(http://livedocs.macromedia.com/coldfusion/7/htmldocs/0696.htm)
Use this method
It does make sense - if the cookies aren't set in the browser, you get
a new session with new cookies.
It occurs to me the same is true regardless of which method you are
using - Application.cfc or a CFAPPLICATION tag. Is that right Jochem?
On 5/23/06, Michael Dinowitz [EMAIL PROTECTED] wrote:
Snake said:
As OnApplicationstart only executes once at the start of an
application this does means you couldn't use it to reset your
application variables, which is a pain IMHO.
Just call OnApplicationstart from somewhere else in application.cfc.
Jochem
James Holmes said:
It does make sense - if the cookies aren't set in the browser, you
get a new session with new cookies.
It occurs to me the same is true regardless of which method you are
using - Application.cfc or a CFAPPLICATION tag. Is that right
Jochem?
Yes.
Jochem
This is why I never use frames.
On 5/23/06, Jochem van Dieten [EMAIL PROTECTED] wrote:
James Holmes said:
It does make sense - if the cookies aren't set in the browser, you
get a new session with new cookies.
It occurs to me the same is true regardless of which method you are
using -
Yep, exactly. However, note that CF only single-threads onApplicationStart()
automatically when IT runs it. If YOU manually re-run onApplicationStart(),
you must lock that method call if you want to prevent race conditions.
On 5/23/06, Jochem van Dieten [EMAIL PROTECTED] wrote:
Snake said:
As
Like I said, logical but just doesn't 'feel' right. :)
It does make sense - if the cookies aren't set in the browser, you get
a new session with new cookies.
It occurs to me the same is true regardless of which method you are
using - Application.cfc or a CFAPPLICATION tag. Is that right Jochem?
About 99% of the code I've seen out there just set a bunch of
Application constansts and components, so this is fine. Don't forget
it, of course, but most folks won't be impacted by it. I typically add
this to onRequestStart:
cfif structKeyExists(url, reinit)
cfset onApplicationStart()
/cfif
On
Ray, Have you given any thought of moving the reinit out of the
application.cfc and into an admin section or the like? I'm never happy about
allowing 'just anybody' who visits my site the ability to reinitialize it.
About 99% of the code I've seen out there just set a bunch of
Application
On Tuesday 23 May 2006 16:05, Michael Dinowitz wrote:
about allowing 'just anybody' who visits my site the ability to
reinitialize it.
cfif structKeyExists(url, reinit)
cfset onApplicationStart()
/cfif
I tend to use
cfif structKeyExists(url, reinit) and
i usually limit the reinit to the small list of dedicated ip's that i
have available
to me (office, home, parents house, in-laws house, etc)
then no matter where i am, i can do it.
tw
On 5/23/06, Tom Chiverton [EMAIL PROTECTED] wrote:
On Tuesday 23 May 2006 16:05, Michael Dinowitz wrote:
See both Tony and Tom's response. In the past, where I have cared, I'd
done Tom's thing of just using a unique value. Like,
reinit=letmedoitorelse.
On 5/23/06, Michael Dinowitz [EMAIL PROTECTED] wrote:
Ray, Have you given any thought of moving the reinit out of the
application.cfc and into an
Ray, Have you given any thought of moving the reinit out of
the application.cfc and into an admin section or the like?
I'm never happy about allowing 'just anybody' who visits my
site the ability to reinitialize it.
I don't think you can move the reinitialization itself out of
ray, et al.
im having a STRANGE Application.cfc issue.
im setting a request var in the onRequest() method
and the value isnt available a page on the first load after
restarting the cfmx server. 2nd, 3rd, 4th load of page
works fine.
but the first one out of the gate, isnt working.
any ideas?
Can you show us the code? Also, why not use onRequestStart? onRequest
has side effects that can come back to haunt you. If you are just
setting request vars, I'd recommend onRequestStart.
On 5/23/06, Tony [EMAIL PROTECTED] wrote:
ray, et al.
im having a STRANGE Application.cfc issue.
im
ill try tonight, and let you know.
the code is on a template at home... ill eff with it tonight, and hit
ya'up if it still is making me crazy :)
tw
On 5/23/06, Raymond Camden [EMAIL PROTECTED] wrote:
Can you show us the code? Also, why not use onRequestStart? onRequest
has side effects that
21 matches
Mail list logo