I thought that the application.cfc was ignored for Flex Remoting 
requests.  I have no idea why I think that, though, especially since it 
is documented that "OnRequest" can interfere with Flex remoting requests.

  I'll add that, I think it's a very bad idea to have "Remote use" CFCs 
that rely on shared scope variables, such as session.


Derrick Anderson wrote:
> 
> 
> i see nothing in the CF community about this and since many here have CF 
> for their back-end apps I figured I'd give it a try.
> 
> I'm using CF7 standard on the backend and communicating to my CFC's with 
> remote object.  The problem I've had for months now is every now and 
> then the onApplicationStart and onSessionStart methods stop firing in my 
> Application.cfc when a Flex request comes in.  It actually appears to 
> ignore the Application.cfc altogether.  The reason I suspect this is 
> because none of my application or session variables exist in my CFC's 
> when this problem happens, aren't those functions supposed to fire 
> automatically? What would cause them not to?
> 
> A restart of the server might fix it, might not- i never know until i 
> tinker with the CFC's and application.cfc file settings until it 
> magically starts working again.  Then a few days later, it's back 
> again.  The relevant parts of my application.cfc are pasted below- has 
> anyone ever seen behavior like this???
> 
> <cfcomponent
>     displayname="Application"
>     output="true"
>     hint="Handle the application.">
>    
>     <cfscript>
>        this.name <http://this.name> = "MyApp";
>        this.applicationTimeout = createTimeSpan(1,0,0,0);
>        this.sessionmanagement = "yes";
>        this.sessiontimeout = createTimeSpan(0,1,0,0);
>        this.scriptProtect = "all";
>    </cfscript>
>  
>     <cffunction
>         name="OnApplicationStart"
>         access="public"
>         returntype="boolean"
>         output="false"
>         hint="Fires when the application is first created.">
>         
>         <cfscript>
>          application.portalDSN = "portal";
>          application.sessions = 0;
>        </cfscript>
>    
>         <cflog file="#this.name# <http://this.name#>" type="Information" 
> text="Application #this.name# <http://this.name#> Started">
>        
>         <cfreturn true />
>     </cffunction>
>    
>     <cffunction name="onSessionStart" output="false">
>         <cfscript>
>            session.started = now();
>            session.projectID = 0;
>            if(cgi.SERVER_NAME CONTAINS "local")
>            {
>                session.clientDSN = "clientBase";
>            }
>            else
>            {
>                session.clientDSN = ListFirst(cgi.SERVER_NAME,".");
>            }
>         </cfscript>
>    
>         <cfquery datasource="#application.portalDSN#" name="qGetClientID">
>         SELECT clientID FROM clients WHERE folderName = <cfqueryparam 
> cfsqltype="cf_sql_varchar" value="#session.clientDSN#">
>         </cfquery>
>         <cfset session.clientID = qGetClientID.clientID>
>      
>         <cflock scope="application" timeout="5" type="Exclusive">
>            <cfset application.sessions = application.sessions + 1>
>         </cflock>
>    </cffunction>
> 

-- 
Jeffry Houser
Flex, ColdFusion, AIR
AIM: Reboog711  | Phone: 1-203-379-0773
--
Adobe Community Expert 
<http://www.adobe.com/communities/experts/members/JeffryHouser.html>
My Company: <http://www.dot-com-it.com>
My Podcast: <http://www.theflexshow.com>
My Blog: <http://www.jeffryhouser.com>

Reply via email to