One thing to keep in mind, if you do not have a *unique *ApplicationName on
your server, then the variables could be shared w/another application--which
is especially dangerous on shared hosting.

I've seen people roll out an application w/a common ApplicationName like
"MainApp" and have issues w/their App scope being shared w/another
application that also used a name of "MainApp". Same thing happens if the
Application.cfc/cfm doesn't define a ApplicationName.

IMO, the safest thing you can do is name define ever ApplicationName with a
hash of the current directory path:

<cfset this.name = hash(getDirectoryFromPath(getCurrentTemplatePath())) />

That way you can use the same code w/every Application.cfc, but your
virtually guaranteed to have a unique ApplicationName.

-Dan

On Mon, Mar 28, 2011 at 2:55 PM, Russ Michaels <[email protected]> wrote:

>
> I think I can see one possible cause of your problem Dave.
> You may actually have 2 applications running.
>
> one on yourdomain.com
> and another on www.yourdomain.com
>
> So if someone goes to yourdoamin.com and then www.yourdomain.com they will
> NOT be seeing the same application.  So perhaps most people go to
> www.yourdomain.com, but every so often someone visits
> yourdoamin.cominstead, which would restart the application if it was
> outside the timeout
> period.
>
> To avoid this you need to add a redirect, so that only 1 domain is in use.
> either redirect www.yourdoamin.com to yourdomain.com or vice versa.
>
> And also change your code to explicit to avoid this problem
>
> if CGI.SERVER_NAME IS "blah.com"
>
> else ... staging
> else ... dev
> else redirect to blah.com
>
>
> On Mon, Mar 28, 2011 at 7:46 PM, Dave Watts <[email protected]> wrote:
>
> >
> > > To confirm my understanding, are you saying that on a very busy site,
> > it's possible that OnApplicationStart might never run again once the app
> > > has started? (server admin and restarts aside.)
> >
> > That's exactly correct.
> >
> > > Since the app is running fine for months and then all of a sudden
> > switches configs, something else then must trigger a call to
> > OnApplicationStart
> > > but with a screwy environment. (I'm going to add logging to track this
> > down but I can't predict when the problem might happen again.)
> >
> > It's entirely possible that (a) the server is stopping and restarting,
> > which will cause all applications to stop, or (b) there's an explicit
> > call to onApplicationStart somewhere within your code - this is
> > actually pretty common.
> >
> > Dave Watts, CTO, Fig Leaf Software
> > http://www.figleaf.com/
> > http://training.figleaf.com/
> >
> > Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
> > GSA Schedule, and provides the highest caliber vendor-authorized
> > instruction at our training centers, online, or onsite.
> >
> >
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343361
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to