Uploaded image for project: 'Lucee Development'
  1. LDEV-96

ORM cache error when secondary cache is enabled and autoManageSession/flushAtRequestEnd are false

    Details

    • Type: Bug
    • Status: Deployed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 4.5.1.000
    • Fix Version/s: 4.5.5.006, Hibernate 3.5.5.62
    • Labels:
      None
    • Sprint:
      January 2017 Release

      Description

      The following ORM settings...

      this.ormSettings = {
      		autoManageSession = false
      		,flushAtRequestEnd = false
      		,secondaryCacheEnabled=true
      	};
      

      ...cause the following org.hibernate.cache.CacheException on OrmReload():

      net.sf.ehcache.CacheException: Another unnamed CacheManager already exists in the same VM. Please provide unique names for each CacheManager in the config or do one of following:
      # Use one of the CacheManager.create() static factory methods to reuse same CacheManager with same name or create one if necessary
      2. Shutdown the earlier cacheManager before creating new one with same name.
      The source of the existing CacheManager is: DefaultConfigurationSource [ ehcache.xml or ehcache-failsafe.xml ]
      }}
      
      h2. Stack trace
      
      {{at net.sf.ehcache.CacheManager.assertNoCacheManagerExistsWithSameName(CacheManager.java:458):458
      at net.sf.ehcache.CacheManager.init(CacheManager.java:355):355
      at net.sf.ehcache.CacheManager.(CacheManager.java:243):243
      at net.sf.ehcache.hibernate.EhCacheRegionFactory.start(EhCacheRegionFactory.java:70):70
      at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:250):250
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1385):1385
      at lucee.runtime.orm.hibernate.SessionFactoryData.buildSessionFactory(Unknown Source):-1
      at lucee.runtime.orm.hibernate.HibernateORMEngine.getSessionFactoryData(Unknown Source):-1
      at lucee.runtime.orm.hibernate.HibernateORMEngine.reload(Unknown Source):-1
      at lucee.runtime.config.ConfigImpl.resetORMEngine(Unknown Source):-1
      at lucee.runtime.orm.ORMUtil.resetEngine(Unknown Source):-1
      at lucee.runtime.listener.ModernAppListener.initApplicationContext(Unknown Source):-1
      at lucee.runtime.listener.ModernAppListener._onRequest(Unknown Source):-1
      at lucee.runtime.listener.MixedAppListener.onRequest(Unknown Source):-1
      at lucee.runtime.PageContextImpl.execute(Unknown Source):-1
      at lucee.runtime.PageContextImpl.execute(Unknown Source):-1
      at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(Unknown Source):-1
      at lucee.loader.servlet.CFMLServlet.service(Unknown Source):-1
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:727):727
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303):303
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208):208
      at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52):52
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241):241
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208):208
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220):220
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122):122
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501):501
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171):171
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102):102
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116):116
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408):408
      at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:193):193
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607):607
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314):314
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145):1145
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615):615
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61):61
      at java.lang.Thread.run(Thread.java:745):745
      

      There is no workaround other than to disable the secondary cache, which has performance implications.

      Previously raised against Railo by Simon Bingham https://issues.jboss.org/browse/RAILO-2233

        Attachments

          Activity

            People

            • Assignee:
              michaeloffner Michael Offner
              Reporter:
              julianhalliwell Julian Halliwell
            • Votes:
              6 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: