1 Reply Latest reply on Jun 29, 2006 3:20 AM by BKBK

    application scope components

    dandev Level 1
      I've been building an image gallery application using components.

      In my application file I have
      <cfset application.gallery = createObject("component","app.gallery").init(application.dsn)>

      Now every time I want to generate a gallery I do this
      <cfset Variables.Gallery = application.gallery.getGallery(URL.fromRec,URL.count,URL.continent,URL.country,URL.city," #URL.pic#")>

      It just occured to me that this may be a problem. I this ok, or will I be affecting every users gallery on the site, by doing this under the application scope?

        • 1. application scope components
          BKBK Adobe Community Professional & MVP
          I think it's OK. You apparently define just one instance of application.gallery. If you don't update it throughout the life of the application, there will be no race conditions. Also, 'variables' is not a shared scope, and so variables.gallery will always be local.