Re: Application.cfc racing

2006-05-23 Thread James Holmes
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

Re: Application.cfc racing

2006-05-23 Thread Jochem van Dieten
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

Re: Application.cfc racing

2006-05-23 Thread Michael Dinowitz
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

Re: Application.cfc racing

2006-05-23 Thread Michael Dinowitz
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;

Re: Application.cfc racing

2006-05-23 Thread Michael Dinowitz
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

2006-05-23 Thread Snake
: 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

Re: Application.cfc racing

2006-05-23 Thread James Holmes
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:

RE: Application.cfc racing

2006-05-23 Thread Jochem van Dieten
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

Re: Application.cfc racing

2006-05-23 Thread Jochem van Dieten
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

Re: Application.cfc racing

2006-05-23 Thread James Holmes
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 -

Re: Application.cfc racing

2006-05-23 Thread Brian Kotek
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

Re: Application.cfc racing

2006-05-23 Thread Michael Dinowitz
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?

Re: Application.cfc racing

2006-05-23 Thread Raymond Camden
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

Reinit Re: Application.cfc racing

2006-05-23 Thread Michael Dinowitz
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

Re: Reinit Re: Application.cfc racing

2006-05-23 Thread Tom Chiverton
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

Re: Reinit Re: Application.cfc racing

2006-05-23 Thread Tony
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:

Re: Reinit Re: Application.cfc racing

2006-05-23 Thread Raymond Camden
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

RE: Reinit Re: Application.cfc racing

2006-05-23 Thread Dave Watts
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

Re: Application.cfc racing

2006-05-23 Thread Tony
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?

Re: Application.cfc racing

2006-05-23 Thread Raymond Camden
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

Re: Application.cfc racing

2006-05-23 Thread Tony
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