Skip to main content
Known Participant
June 5, 2009
Question

cleaning out the application variables

  • June 5, 2009
  • 4 replies
  • 656 views

Hi,

I set my datasource in the Application cfc like this

<cffunction name="onRequestStart" access="public" returntype="void">
   
    
   
    <cfif NOT IsDefined("application.datasource")>
   
        <cfset application.datasource="mysite">
       
     </cfif>

If I have to look at another site running on the same local development server if often cannot connect as the application is trying to connect to the other datasource. Is there a way to flush out the application variables in administrator?

Thanks,

H.

    This topic has been closed for replies.

    4 replies

    Inspiring
    June 8, 2009

    Oops.  Sorry.  Wrong thread.

    Participating Frequently
    June 6, 2009

    You have something configured very badly then. You can have as many

    applications as you want on a server and each application has it's own

    name and it's own application variables (meaning that the datasource

    variable from one application will be independent from the datasource

    variable of another application).

    Where do you have your Application.cfc file ?

    Also, I usually have set my application variables in

    onApplicationStart and have a trigger to reset the application in

    onRequestStart:

    
      
    
    ]]>

    Mack

    BKBK
    Community Expert
    Community Expert
    June 5, 2009

    OnApplicationStart seems to me to be the best place for the code, not onRequestStart.

    Known Participant
    June 5, 2009

    Rename

    Application.Name="new name"