Skip navigation
Currently Being Moderated

application.cfc example bug cflock scope session or application

Jun 27, 2012 4:19 PM

Tags: #application #session #bug #scope #documentation #application.cfc #cf10 #coldfusion10 #cflock

In the adobe coldfusion 10 documentation, on page: 9461172e0811cbec22c24-7d39.html#WSc3ff6d0ea77859461172e0811cbec0b63c-7 ff1


this page can be found by going to:

" 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?

  • Currently Being Moderated
    Jun 27, 2012 4:28 PM   in reply to

    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).




    Mark as:
  • Currently Being Moderated
    Jun 28, 2012 1:39 AM   in reply to

    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".

    Mark as:
  • Currently Being Moderated
    Jul 1, 2012 8:29 PM   in reply to 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 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.




    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points