Accessing the Application Scope of another App

2012-02-08 Thread Brook Davies

Hi,

Can you guys tell me if this is bad practice or will lead to memory issues.
I have a CF app that has the main app and an admin module, each with their
own cfapplication, and application namepace. From within the admin app I
need to clear some application scoped data in the main app. 

I do something like this:

cffunction..

cfif application.applicationName is  COREAPP
cfset local.appScopeReference = application
cfelse
cfset local.appScopeReference =
createObject(java,coldfusion.runtime.ApplicationScopeTracker)
..getApplicationScope('COREAPP')
/cfif

cflock scope=application type=exclusive
  cfset structDelete(local.appScopeReference,'somekey')
/cflock

/cffunction

Is there gonna be an issues with dumping the app scope into a local variable
like this? Or something else?

Brook 




~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349841
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Accessing the Application Scope of another App

2012-02-08 Thread James Holmes

Did you know you can just write a new cfapplication tag to swap to the
other app, delete the key and then swap back again with a subsequent
cfapplication tag?

--
Shu Ha Ri: Agile and .NET blog
http://www.bifrost.com.au/


On 9 February 2012 04:13, Brook Davies cft...@logiforms.com wrote:


 Hi,

 Can you guys tell me if this is bad practice or will lead to memory issues.
 I have a CF app that has the main app and an admin module, each with their
 own cfapplication, and application namepace. From within the admin app I
 need to clear some application scoped data in the main app.



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349843
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm