Peter sent in an interesting question this morning, especially as it relates to my last presentation:
Just wanted to quickly check something about your App.cfc reference:The onApplicationStart and onRequestStart functions have a returntype of Boolean, whilst the rest are all Void.
Is there a reason for these two being different than the others, particularly the onSessionStart function?
The fact that you can return true or false in onApplicationStart and onRequestStart simply are ways to let you abort the application start up, or request, based on some condition. The example I believe I gave in my presentation was doing a quick database check. If the check fails, then send some kind of message to the admin and prevent the application from starting up. You could do the same in onRequestStart, although it is probably overkill to check every request. What you could do instead is log the last time you checked (in the application scope for example), and check only if sixty minutes have passed.
Anyone out there using something like this in their Application.cfc files?
Archived Comments
You also alluded to creating a shorter variable name that shared the same memory location as the Application scope, so that you could refer to
app.ObjectName.Method
as opposed to
Application.ObjectName.Method.
Thanks.
Didn't see your entry about the presentation; the rss syndicate e-mail hasn't been working for the last few days.
Not using it at the moment (obviously), but that database check does sound a sensible thing to do, so I probably will implement that. :)
Peter - what RSS isn't working for you? The email subscription? The Feedburner URL?
Oh sorry, that's just a local thing - we have a daily e-mail that sends a CF feed (feed-squirrel I think) to all the developers in the company.
Haven't received one since Friday morning, but I keep forgetting to mention it to my manager.
You can always use RSSWatcher.com. It lets you monitor rss feeds and send emails.
Just signed up. :)
I may be missing something but the search profile page says "To view all the matches for a search profile, simply click on the name of the profile." - except I don't see a profile name to click on?
Sorry, you click on View in the Matches column on your Search Profiles page.
Ah, currently 0 matches - I'm guessing that's just because there's no new entries since I created the profile?
Exactly. It searches once an hour.