Time out while attempting to lock beanfactory.createmodel.

Hello,

We had a time out locking error while injecting a bean session. The
problem occurs as soon as we load our home page and initiate a login.

The way we set the bean session in the handler is
<cfset var bnSession = getModel('bnSession1')>

The model mappings has the following code:
addModelMapping('bnSession1','common.bnSession');

We used a getModel to populate the bnSession. We made sure it is
wired properly in model mappings. The number of arguments in our
bnSession is 230. When we test the application with a load of 300
users and above it throws out an error (CFMessage=A timeout occurred
while attempting to lock beanfactory.createmodel.common.bnSession.)

Our understanding is that because the bean session has 230 arguments,
during high loads the locks are not properly released.

The following below is the complete error message.

"ERROR","OPRS","03/07/2012","08:38:03","OPRS","Application Execution
Exception CFErrorType=Lock CFMessage=A timeout occurred while
attempting to lock beanfactory.createmodel.common.bnSession.
CFStackTrace=coldfusion.tagext.lang.LockTag$TimeoutException: A
timeout occurred while attempting to lock
beanfactory.createmodel.common.bnSession. at
coldfusion.tagext.lang.LockTag.doStartTag(LockTag.java:220) at
cfBeanFactoryCompat2ecfc979011107$funcGETMODEL.runFunction(D:\http\html
\coldbox3\system\plugins\BeanFactoryCompat.cfc:225) at
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at
coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at
coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:
405) at coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:
321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:517) at
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:496) at
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:355) at
coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2301) at
cfBeanFactory2ecfc174588449$funcGETMODEL.runFunction(D:\http\html
\coldbox3\system\plugins\BeanFactory.cfc:82) at
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at
coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at
coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:
405) at coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:
321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:517) at
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:496) at
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:355) at
coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2301) at
cfFrameworkSupertype2ecfc1301377880$funcGETMODEL.runFunction(D:\http
\html\coldbox3\system\FrameworkSupertype.cfc:109) at
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at
coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at
coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:
405) at coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:
321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at
coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2582) at
cfehGeneral2ecfc1341626773$funcDOORGAFFDBINFOVIALDAP.runFunction(D:
\http\html\oprs\handlers\ehGeneral.cfc:638) at
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at
coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at
coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:
405) at coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:
321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:517) at
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:496) at
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:355) at
coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2301) at
coldfusion.tagext.lang.InvokeTag.doEndTag(InvokeTag.java:389) at
coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2723) at
cfController2ecfc1692756455$funcINVOKER.runFunction(D:\http\html
\coldbox3\system\web\Controller.cfc:694) at
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at
coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at
coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:
405) at coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:
321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at
coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2582) at
cfController2ecfc1692756455$funcRUNEVENT.runFunction(D:\http\html
\coldbox3\system\web\Controller.cfc:579) at
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at
coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at
coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:
405) at coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:
321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:517) at
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:496) at
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:355) at
coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2301) at
cfColdbox2ecfc1080309736$funcPROCESSCOLDBOXREQUEST.runFunction(D:\http
\html\coldbox3\system\Coldbox.cfc:243) at
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at
coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:
405) at coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:
321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at
coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2582) at
cfApplication2ecfc423675354$funcONREQUESTSTART.runFunction(D:\http\html
\oprs\Application.cfc:61) at
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at
coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:
405) at coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:
321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:491) at
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:337) at
coldfusion.runtime.AppEventInvoker.invoke(AppEventInvoker.java:88)
at
coldfusion.runtime.AppEventInvoker.onRequestStart(AppEventInvoker.java:
258) at
coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:
349) at
coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:
48) at
coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:94) at
coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70) at
coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:
79) at
coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:
28) at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:
38) at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:
46) at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:
38) at
coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62) at
coldfusion.CfmServlet.service(CfmServlet.java:200) at
coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:
89) at jrun.servlet.FilterChain.doFilter(FilterChain.java:86) at
com.seefusion.Filter.doFilter(Filter.java:49) at
com.seefusion.SeeFusion.doFilter(SeeFusion.java:1500) at
jrun.servlet.FilterChain.doFilter(FilterChain.java:94) at
coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:
42) at
coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:
46) at jrun.servlet.FilterChain.doFilter(FilterChain.java:94) at
jrun.servlet.FilterChain.service(FilterChain.java:101) at
jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106) at
jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at
jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:
286) at
jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:
543) at
jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:
203) at jrunx.scheduler.ThreadPool
$DownstreamMetrics.invokeRunnable(ThreadPool.java:320) at
jrunx.scheduler.ThreadPool
$ThreadThrottle.invokeRunnable(ThreadPool.java:428) at
jrunx.scheduler.ThreadPool
$UpstreamMetrics.invokeRunnable(ThreadPool.java:266) at
jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
CFTagContext=ID: CFLOCK; LINE: 225; TEMPLATE: D:\http\html
\coldbox3\system\plugins\BeanFactoryCompat.cfc ID: CF_TEMPLATEPROXY;
LINE: 82; TEMPLATE: D:\http\html\coldbox3\system\plugins
\BeanFactory.cfc ID: CF_TEMPLATEPROXY; LINE: 109; TEMPLATE: D:\http
\html\coldbox3\system\FrameworkSupertype.cfc ID: CF_UDFMETHOD; LINE:
638; TEMPLATE: D:\http\html\oprs\handlers\ehGeneral.cfc ID:
CFINVOKE; LINE: 694; TEMPLATE: D:\http\html\coldbox3\system\web
\Controller.cfc ID: CF_UDFMETHOD; LINE: 579; TEMPLATE: D:\http\html
\coldbox3\system\web\Controller.cfc ID: CF_TEMPLATEPROXY; LINE: 243;
TEMPLATE: D:\http\html\coldbox3\system\Coldbox.cfc ID: CF_UDFMETHOD;
LINE: 61; TEMPLATE: D:\http\html\oprs\Application.cfc"

Let us know what your thoughts are on this.

Thanks
Hari

Is the bean a singleton?

Otherwise I don’t see why you would need to lock this?

Yes Scott,

Our bean is a singelton…

Well its actually Andrew.

But why would you create a bean as a singleton, if you are going to change its contents? It would make more sense to remove that from the bean, and re-instantiate it when you need it.

That would make more sense to me.

Bean, by definition, should be per-request, transient object?