Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

cleaning out the application variables

Explorer ,
Jun 05, 2009 Jun 05, 2009

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.

596
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 05, 2009 Jun 05, 2009

Rename

Application.Name="new name"

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 05, 2009 Jun 05, 2009

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 06, 2009 Jun 06, 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:

<cfif StructKeyExists(Url, "reinit")>
  <cfset onApplicationStart()>
</cfif>

Mack

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jun 08, 2009 Jun 08, 2009
LATEST

Oops.  Sorry.  Wrong thread.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources