Issues clearing application scope

66 views
Skip to first unread message

Jay B

unread,
Jul 21, 2015, 10:54:24 AM7/21/15
to lu...@googlegroups.com
I am setting a variable in application.cfc

    <cfif isdefined("application.Portcullis") eq false>
            <cfset application.Portcullis = createObject("component","cfc.Portcullis").init()/>
     </cfif>

In OnRequestStart I have

    <cfif structKeyExists(url,'reinit')>
            <cfset OnApplicationStart() />
    </cfif>

So if I add ?reinit=1 to the url the application should restart.

If I make changes to the component, and do a ?reinit=1 -most- of the time, this seems to work but some times the only way I can get the changes to take effect is to restart the service

I have Inspect Template set to Always, I clear the object cache. I've even tried deleting the cfc from the server to try throw an error but it doesn't even do that...sometimes.

Any thoughts on why this might be? It's very frustrating.



Sean Daniels

unread,
Jul 21, 2015, 11:10:08 AM7/21/15
to lu...@googlegroups.com
Maybe add a call to onApplicationEnd() before onApplicationStart() in your reinit block?
> --
> You received this message because you are subscribed to the Google Groups "Lucee" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
> To post to this group, send email to lu...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/195953ec-1590-49ae-9f06-03f84ad12e9d%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Jay B

unread,
Jul 21, 2015, 11:14:38 AM7/21/15
to lu...@googlegroups.com
I'll give that a try...Thanks

Igal @ Lucee.org

unread,
Jul 21, 2015, 11:25:29 AM7/21/15
to lu...@googlegroups.com
so to clarify, your test and assignment of Application.Portcullis is done inside Application's onApplicationStart(), right?  your original post does not indicate that.

Igal Sapir
Lucee Core Developer
Lucee.org

On 7/21/2015 8:14 AM, Jay B wrote:
I'll give that a try...Thanks
--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.

Adam Cameron

unread,
Jul 21, 2015, 12:22:10 PM7/21/15
to lu...@googlegroups.com


On Tuesday, 21 July 2015 15:54:24 UTC+1, Jay B wrote:

    <cfif structKeyExists(url,'reinit')>
            <cfset OnApplicationStart() />
    </cfif>


If you want to restart yer app, you really should restart yer app, not just call the event handler which runs when the app starts.

Doing things this way is kinda like thinking calling a JS onclick event handler will make your actual mouse button depress.

To restart the app... run applicationStop(). On the next request the application will completely restart properly.

-- 
Adam


 
Reply all
Reply to author
Forward
0 new messages