> I hate to be heathenous and use the letters ASP, but ASP 
> has a feature that detects when the the application is being 
> shutdown (Application_OnEnd in the global.asa) and you can 
> take some actions at that time.  Is there any equivalent in 
> CF?

There's nothing in CF which is directly analogous to this. In CF,
applications don't get explicitly unloaded - they time out. When an
application times out, typically everything stored in memory for that
application is refreshed when the next user visits the application. The act
of timing out is enough to flush Application-scoped variables from memory,
so there's little need for a cleanup event at the time of shutdown.

> My thought was to track unique users in a structure, and
> write them out to a logfile when the application was shut
> down.  I know there are other ways to go about it, but this
> particular approach interests me.

There's a problem with this approach, I think.

Applications don't usually get "shut down". They expire after a period of
inactivity. So, as long as there were active users in the application, that
application would never expire, and you'd never get your log updated. You
wouldn't usually want to explicitly unload an ASP application from MMC
unless something went wrong, I'd think, and that would be the only time the
Application_OnEnd event would fire.

> I'd hate to think ASP had us beat here!

There are a few things which ASP does that CF doesn't, or that ASP does
better than CF. The reverse is certainly true. I'd guess that would be true
for any two programming languages that you could compare, and by itself,
doesn't help anyone trying to choose the right language for a task.

In fact, ASP, being a lower-level environment (I used the word "language"
above, even though ASP isn't a programming language but rather a set of
objects and methods available to any Windows Scripting language), allows you
to do quite a few things that you can't do in CF - at least, that you can't
do easily. Fortunately for CF developers, most of these things aren't that
important. CF focuses on making common web development tasks easy.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to