ColdBox 3.6 - Disable Session Management?

HI folks,

This thread builds upon the discussion here - https://mail.google.com/mail/u/1/?ui=2&shva=1#search/from%3Ame/13ff25befd2b3a23 - in terms of load on the app/system.

My app essentially doesn’t need to use session or client managment, so I disabled the settings in my Application.cfc. Ultimately I’m trying to remove as much strain on the server as possible, thus removing the need for new sessions to be spun up.

I also removed any DI references to the sessionStorage plugin, and changed my CB config to use ‘application’ for the flashURLPersistScope setting.

When i disabled the settings I received the following error (see below).

It seems that (by default ??) CB requires session management to be on? Is there a way to disable this, or could I be missing something?

Thanks!

Nolan

Session scope is the default storage location for Flash RAM. You should be able to switch Flash RAM to store elsewhere in your ColdBox config:

http://wiki.coldbox.org/wiki/FlashRAM.cfm#Configuration

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Thanks Brad, it seems like there is no way to disable flashRam though. I don’t need to use this at all. Could I achieve this by setting it to use the default cache which uses the application scope?

Thanks

Yes, just set it to something other than session and it won’t try to access the scope.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Hi Brad,

I tried changing the setting to cache and cluster and I still get the error. It’s happening really early in the ColdBox request lifecyle. Below is the full stacktrace. Could there be something else I’m missing? Thanks.

session scope is not enabled
at railo.runtime.PageContextImpl.checkSessionContext(PageContextImpl.java:1201):1201
at railo.runtime.PageContextImpl.sessionScope(PageContextImpl.java:1186):1186
at railo.runtime.PageContextImpl.sessionScope(PageContextImpl.java:1182):1182
at railo.runtime.tag.Lock.doStartTag(Lock.java:199):199
at system.web.flash.sessionflash_cfc$cf.udfCall(/Library/WebServer/Documents/myapp/webapp/frameworks/coldbox/system/web/flash/SessionFlash.cfc:43):43
at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:103):103
at railo.runtime.type.UDFImpl._call(UDFImpl.java:371):371
at railo.runtime.type.UDFImpl.call(UDFImpl.java:284):284
at railo.runtime.ComponentImpl._call(ComponentImpl.java:607):607
at railo.runtime.ComponentImpl._call(ComponentImpl.java:490):490
at railo.runtime.ComponentImpl.call(ComponentImpl.java:1781):1781
at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:723):723
at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1506):1506
at system.coldbox_cfc$cf._1(/Library/WebServer/Documents/myapp/webapp/frameworks/coldbox/system/Coldbox.cfc:336):336
at system.coldbox_cfc$cf.udfCall(/Library/WebServer/Documents/myapp/webapp/frameworks/coldbox/system/Coldbox.cfc):-1
at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:103):103
at railo.runtime.type.UDFImpl._call(UDFImpl.java:371):371
at railo.runtime.type.UDFImpl.call(UDFImpl.java:284):284
at railo.runtime.ComponentImpl._call(ComponentImpl.java:607):607
at railo.runtime.ComponentImpl._call(ComponentImpl.java:490):490
at railo.runtime.ComponentImpl.call(ComponentImpl.java:1781):1781
at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:723):723
at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1506):1506
at application_cfc$cf.udfCall(/Library/WebServer/Documents/myapp/webapp/Application.cfc:204):204
at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:103):103
at railo.runtime.type.UDFImpl._call(UDFImpl.java:371):371
at railo.runtime.type.UDFImpl.call(UDFImpl.java:284):284
at railo.runtime.ComponentImpl._call(ComponentImpl.java:607):607
at railo.runtime.ComponentImpl._call(ComponentImpl.java:490):490
at railo.runtime.ComponentImpl.call(ComponentImpl.java:1781):1781
at railo.runtime.listener.ModernAppListener.call(ModernAppListener.java:346):346
at railo.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:107):107
at railo.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:18):18
at railo.runtime.PageContextImpl.execute(PageContextImpl.java:2255):2255
at railo.runtime.PageContextImpl.execute(PageContextImpl.java:2222):2222
at railo.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:315):315
at railo.loader.servlet.CFMLServlet.service(CFMLServlet.java:29):29
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717):717
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290):290
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206):206
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646):646
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436):436
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374):374
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302):302
at org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:213):213
at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:171):171
at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145):145
at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92):92
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:394):394
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235):235
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206):206
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233):233
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191):191
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127):127
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102):102
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109):109
at net.stax.appserver.webapp.RequestMonitorValve.invoke(RequestMonitorValve.java:35):35
at net.stax.appserver.webapp.RequestSetupValve.invoke(RequestSetupValve.java:31):31
at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:647):647
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293):293
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859):859
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602):602
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489):489
at java.lang.Thread.run(Thread.java:680):680

Show us your config, please.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Create a dummy flash.

your config:

flash = {
scope = “com.common.model.flash.DummyFlash”
};

your DummyFlash:

component extends=“coldbox_3_5_3.system.web.flash.AbstractFlashScope” hint=“A customized implementation of the ColdBox flash scope.”{
public any function init(controller) {
super.init(argumentCollection=arguments);
return this;
}

public any function getFlashKey(){
return ‘’;
}

public any function saveFlash(){
return ;
}

public any function flashExists(){
return false;
}

public any function getFlash(){
return {};
}

public any function removeFlash(){
return ;
}
}

Hi guys,

Aaron, thanks for the snippet. I may try that approach.

Brad, here is my configure function in ColdBox config:

function configure(){

//converts the coldbox app mapping to a dot class path for instantiations, not part of a regular config

var appMappingDotNotation = reReplace(appMapping,"(/|\)",".",“all”);

// coldbox directives

coldbox = {

//Application Setup

appName = “My App”,

eventName = “event”,

//Development Settings

debugMode = false,

debugPassword = “”,

reinitPassword = “”,

handlersIndexAutoReload = false,

configAutoReload = false,

//Implicit Events

defaultEvent = “General.index”,

requestStartHandler = “Main.onRequestStart”,

requestEndHandler = “Main.onRequestEnd”,

applicationStartHandler = “Main.onAppInit”,

applicationEndHandler = “”,

sessionStartHandler = “”,

sessionEndHandler = “”,

missingTemplateHandler = “”,

//Extension Points

UDFLibraryFile = “includes/helpers/ApplicationHelper.cfm”,

coldboxExtensionsLocation = “”,

modulesExternalLocation = [],

pluginsExternalLocation = “”,

viewsExternalLocation = “”,

layoutsExternalLocation = “”,

handlersExternalLocation = “”,

// Register your RequestContextDecorator within your Coldbox.cfc or your ColdBox XML file by telling ColdBox where the CFC lives

requestContextDecorator = “model.coldbox.RequestContextDecorator”,

//Error/Exception Handling

exceptionHandler = “Main.onException”,

onInvalidEvent = “General.invalid”,

customErrorTemplate = “”,

//Application Aspects

handlerCaching = true,

eventCaching = true,

proxyReturnCollection = false,

flashURLPersistScope = “cache”

};

I think I got it fixed.

My coldBox config only had the flashURLPersistScope = “cache” setting.

I added in:

// flash scope configuration

flash = {

scope = “cache”,

properties = {}, // constructor properties for the flash scope implementation

inflateToRC = true, // automatically inflate flash data into the RC scope

inflateToPRC = false, // automatically inflate flash data into the PRC scope

autoPurge = true, // automatically purge flash data for you

autoSave = true // automatically save flash scopes at end of a request and on relocations.

};

and the error went away. are both required? Is the first setting necessary?

Thanks.

You’re using a setting which is no longer valid in the config:

flashURLPersistScope= “cache”

http://wiki.coldbox.org/wiki/Compatibility:3.5.0.cfm#flashURLPersistScope_Removed

Use the flash struct like Aaron showed.

flash = {
scope = “blah”
};

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

are both required? Is the first setting necessary?

Check out my last reply. The setting you had first been using is no longer part of ColdBox.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Okay great. Thanks for confirming.

I will try that.

Nolan

Got it to work. Thanks guys!

Nolan