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

application.cfc example bug cflock scope session or application

New Here ,
Jun 27, 2012 Jun 27, 2012

Copy link to clipboard

Copied

In the adobe coldfusion 10 documentation, on page: http://help.adobe.com/en_US/ColdFusion/10.0/Developing/WSc3ff6d0ea77859461172e0811cbec22c24-7d39.htm...

this page can be found by going to: www.adobe.com

" Home / Developing ColdFusion 10 Applications / Developing CFML Applications / Designing and Optimizing a ColdFusion Application " Defining the application and its event handlers in Application.cfc

ON this page, there is an example application.cfc After looking at the code, I am wondering if there is a typo/bug in the following code:

... ...

Should it be:

(A) cflock ... scope="SESSION" or

(B) cflock ... scope="APPLICATION" ?

If it is (A). then I am confused, can someone explain why?

Views

1.3K

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
LEGEND ,
Jun 27, 2012 Jun 27, 2012

Copy link to clipboard

Copied

Don't be confused... it's an error in the docs.  You could do Adobe a favour by commenting at the bottom of the page: they do monitor those comments (they don't always react, but the do monitor them).

onSessionStart() is intrinsically single-threaded as far as the session scope goes: it's only ever run once per session (when the session starts...).

On the other hand the code in question def wants to single-thread access to that application-scoped variable as we don't want two simultaneous sessions hitting it for any given single value of it (if that makes sense).

--

Adam

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
New Here ,
Jun 30, 2012 Jun 30, 2012

Copy link to clipboard

Copied

That is what I thought. but I wanted to confirm it was truely a bug before putting it on the page. Thank You for confirming that it should be "Application"

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
Engaged ,
Jul 01, 2012 Jul 01, 2012

Copy link to clipboard

Copied

LATEST

dgleneck@ndi-inc.org wrote:

That is what I thought. but I wanted to confirm it was truely a bug before putting it on the page. Thank You for confirming that it should be "Application"

Hi all,

I saw this thread earlier and went ahead and added a note to that doc page on behalf of dgleneck@ndi-inc.org and crediting Adam and BKBK.  And I added a link back to this thread.  Didn't want it to get missed, so thought I'd help there.

Thanks,

-Aaron

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
Community Expert ,
Jun 28, 2012 Jun 28, 2012

Copy link to clipboard

Copied

It should be (B). The documentation says this elsewhere.

To see this, click on your own link above. Scroll to the table in the section "Using application event handlers". Click on the link OnSessionStart. You will see the same sample code, this time with session="application".

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