OnApplicationStart runs the first time ANY user hits your site. It's
commonly used for setting application variables that rarely change. Things
like datasources are a good place for that or initializing a ton of
cfobjects. I commonly put a cfif statement in my onRequest event to reset
the application variables. like this:

<cffunction name="OnRequest">
  <cfif isDefined("attributes.resetVars")>
     <cfset onApplicationStart()/>
  </cfif>
</cffunction>

That way if you can rerun the function from any request.

Steve

On Sun, Sep 28, 2008 at 8:57 PM, Sherif Abdou <[EMAIL PROTECTED]>wrote:

> I am new to ColdFusion and I am having trouble understanding what is the
> Difference between onApplicationStart method and onRequestStart method
> other
> than the Scope. For Example what does it mean by Application? First time a
> user comes to your site? Does it only run once? I tried to set a Variable
> in
> the onApplicationStart method like <cfset APPLICATION.ds="myDataSource"/>
> and I get an Error when I say use it in index.cfm. Am i allowed to use this
> outside in other files Or anything that gets set in onApplicationStart gets
> passed to onApplicationEnd and thats where the variable get used? Thanks.
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:313192
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to