Hi - I'm trying to use application.cfc on a new app I'm building and I'm having 
a strange occurrence.  I'm sure it's just because I'm not as familiar with it 
as application.cfm, but I am trying to 'avoid' just switching back to 
application.cfm.  Here's the issue:

I have the following code.  When I try to execute my URL with the 
reloadConfig=yes parameter, The app fails on the first line of the 
onSessionStart() function with 'application.datasource does not exist.'  Since 
onSessionStart is called AFTER onApplicationStart(), clearly, the <cfsets that 
set application.datasource occur before that line of code.  Any ideas?  

<cfcomponent output="false">
        <cfset this.name = "zarts_tag_prod">
        <cfset this.SessionManagement = true>
        <cfset this.sessionTimeout = createTimeSpan(7,0,0,0)>
        <cfset this.ApplicationTimeout = createTimeSpan(30,0,0,0)>
        <cfif isDefined("url.reloadConfig") AND (isBoolean(url.reloadConfig) 
AND url.reloadConfig)>
                <cfset onApplicationStart() >
        </cfif>
        <cfif isDefined("url.reloadSession") AND (isBoolean(url.reloadSession) 
AND url.reloadSession)>
                <cfset onSessionStart() >
        </cfif>
        <cffunction name="OnApplicationStart" access="public" 
returntype="boolean">
                <cfset application.datasource = "zarts_tag">
                <cfset application.from_email = "[EMAIL PROTECTED]">
                <cfset application.developer = "[EMAIL PROTECTED]">
                <cfset application.baseURL = "http://tag.zarts.com";>
                <cfset application.verify_page = "verify.cfm">
                <cfset application.game_name = "ZARTS TAG">
                <cfset application.authentication_cookie_name = 
"cookie.authenticated">
                <cfset application.zarts_tag_from_email = "[EMAIL PROTECTED]">
                <cfreturn true/>
        </cffunction>
        <cffunction name="onSessionStart">
                <cfset session.security = 
createObject("component","com.security").init(application.datasource)>
                <cfset session.user = 
createObject("component","com.user").init()>
                <cfset session.isAuthorized = false>
        </cffunction>
</cfcomponent> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:315801
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to