Issues clearing application scope

I am setting a variable in application.cfc

<cfif isdefined("application.Portcullis") eq false>
        <cfset application.Portcullis = 

createObject(“component”,“cfc.Portcullis”).init()/>

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.

<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()
http://docs.lucee.org/reference/functions/applicationstop.html. On the
next request the application will completely restart properly.On Tuesday, 21 July 2015 15:54:24 UTC+1, Jay B wrote:


Adam

Maybe add a call to onApplicationEnd() before onApplicationStart() in your reinit block?> On Jul 21, 2015, at 10:54 AM, Jay B <@Jay_B> wrote:

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.


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+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@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.