Skip to main content
Giambattista Scivoletto
Participant
August 21, 2011
Question

Same Application Variables name in different websites on the same server.

  • August 21, 2011
  • 1 reply
  • 408 views

Hi,

I have two websites in the same server that use both their own Application.cfm file.

In each Application.cfm file is defined the application variable Application.DB

In website1 the Application.DB = DB1

In website2 the Application.DB = DB2

Since I'm studying Application.CFC solution, and I did read that application variables with same name have as scope the entire server ... I'm a bit worried. This happen also with Application.CFM ?

This topic has been closed for replies.

1 reply

Inspiring
August 21, 2011

Since I'm studying Application.CFC solution, and I did read that application variables with same name have as scope the entire server ... I'm a bit worried. This happen also with Application.CFM ?


That's not quite how it works.  Each application has its own name, and application.foo on one application (name) is a different variable from application.foo within a different application (name).

Reading these sections of the docs might help:

Configuring and using application variables:

http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec0c35c-7fec.html

cfapplication:

http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7d69.html

About applications:

http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec0b63c-7fda.html

Defining the application and its event handlers in Application.cfc:

http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec22c24-7d39.html

You should definitely be using Application.cfc, not Application.cfm, btw.

--

Adam

--

Adam