Skip to main content
Inspiring
July 12, 2006
Question

About locking Application variables

  • July 12, 2006
  • 1 reply
  • 196 views
Regarding Application variables, the CF documantation states: "This issue is a problem even for write-once read-many variables ..... "
I have an application where Application variables ('Application.dataSource' and 'Application.(instanceObject of a cfc)' are created in Application.cfc and only read, never modified or otherwise written to in any of the templates.
Could there possible be race conditions or some other reason to need locking in this situation? Is there really a need to test for the existence of these variables with the templates all being under Application.cfc?
Someone, please throw some light on this subject.
Carlos
    This topic has been closed for replies.

    1 reply

    Participating Frequently
    July 12, 2006
    I wouldn't worry about locking them when you create them. If you are only reading from them, then create them in the onApplicationStart method of application.cfc.

    As far as checking for their existence, well you could argue either way. I personally wouldn't. But that's me, I'm sure there are others out there who would.