Re: Race conditions at start up

2004-02-26 Thread Matt Liotta
That is interesting. Prior to CFMX, it was guaranteed that the first request would complete before any additional request were handled. J2EE has the notion of startup Servlets that are run prior to the server being able to handle requests. You could configure a startup Servlet to run after all

Re: Race conditions at start up

2004-02-26 Thread Brook Davies
Matt, Thank you, sounds like a good idea. Any chance you could point me towards some resources to learn how to do this? Brook At 11:39 AM 2/26/2004, you wrote: That is interesting. Prior to CFMX, it was guaranteed that the first request would complete before any additional request were

RE: Race conditions at start up

2004-02-26 Thread Gaulin, Mark
You could use an exclusive lock (cflock)... race conditions are what it's for. (It also works in pre-cfmx versions of cf.) If you want to avoid locking on every single hit (after the initialization is done) then use a two-layer kind of test like this pseudo code: if not

RE: Race conditions at start up

2004-02-26 Thread Barney Boisvert
CFLOCK.I usually do something like this in Application.cfm: cflock scope=application type=readonly cfset needsRefresh = NOT structKeyExists(application, app_vars_loaded) / /cflock cfif needsrefresh cflock scope=application type=exclusive cfif NOT structKeyExists(application, app_vars_loaded)