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

Application Variables in a Shared Server Environment

Contributor ,
Dec 06, 2006 Dec 06, 2006

Copy link to clipboard

Copied

My application looks rather like a shared server environment where different groups of users connect to different databases while all using the same cfm pages.

Is there a way to have an Application scope that is different for each group of users?

Or how is this achieved on a typical web shared server?

Doug
TOPICS
Advanced techniques

Views

265

Translate

Translate

Report

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
Advisor ,
Dec 06, 2006 Dec 06, 2006

Copy link to clipboard

Copied

There is only one Application scope.

For variables that are group specific, use the Client Scope.

Votes

Translate

Translate

Report

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
Contributor ,
Dec 06, 2006 Dec 06, 2006

Copy link to clipboard

Copied

Thanks very much and that seems to be the way to go, but can you help me to understand how things work on a shared server: -

How is it possible that on my website host's shared server for example, I can set any application variable I like and use onApplicationStart and they all apply only to my website, when there are dozens of other users all sharing ColdFusion?

Doug

Votes

Translate

Translate

Report

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
Advisor ,
Dec 06, 2006 Dec 06, 2006

Copy link to clipboard

Copied

First, if your host is any good at all, all the different hosting clients are not strictly sharing CF.

The host should be using CF Enterprise and running each client in their own instance.

Anyway, the application variables are controlled by the cfapplication tag or by the Application.cfc name value.

On a given server instance, each application name has its own Application scope.

Since a given set of files can only use one App tag or App cfc, they can only have one Application scope.

Anyway, the values you want are NOT constant throughout the application so they don't belong in the application scope per se.

Unless, maybe, you did something like this:

Application.UsrGroups[1].name = grunts
Application.UsrGroups[1].datasource = grunt_DB
Application.UsrGroups[2].name = Bosses
Application.UsrGroups[2].datasource = Boss_DB
etc.


But it is still probably cleaner to set the key values in the Client scope.

Votes

Translate

Translate

Report

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
Contributor ,
Dec 06, 2006 Dec 06, 2006

Copy link to clipboard

Copied

LATEST
Thanks so much for your time. I can now fully understand what is going on and you're right the Client scope does provide exactly what I want.

Many thanks,
Doug

Votes

Translate

Translate

Report

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
Documentation