title: Transaction timeout exception when using ehCache
body: <p>I have ehCache configured in my application which depends on jtaTransaction</p>
  
  <pre><code>&lt;bean id="ehcacheManager"
              class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"
              depends-on="jtaTransactionManagerLookup"
              p:configLocation="classpath:ehcache/ehcache.xml"/&gt;
  </code></pre>
  
  <p>Transaction beans are defined below </p>
  
  <pre><code>&lt;bean id="jtaTransactionManagerLookup" class="cdot.jta.TransactionManagerLookup"
          c:transactionManager-ref="transactionManager"
      /&gt;
  
  &lt;bean id="transactionManager"
              class="org.springframework.transaction.jta.JtaTransactionManager"&gt;
              &lt;property name="transactionManager" ref="jtaTransactionManager" /&gt;
              &lt;property name="userTransactionName" value="UserTransaction"/&gt;
              &lt;property name="transactionSynchronizationRegistryName" value="java:TransactionSynchronizationRegistry"/&gt;
              &lt;property name="defaultTimeout" value="300"/&gt;
          &lt;/bean&gt;
  </code></pre>
  
  <p>I tried including the property <code>defaultTimeout</code> as well but still running into transaction issues.</p>
  
  <p>Error Trace:</p>
  
  <pre><code>org.hibernate.cache.CacheException: net.sf.ehcache.transaction.TransactionTimeoutException: transaction timed out
      at org.hibernate.cache.ehcache.internal.regions.EhcacheTransactionalDataRegion.get(EhcacheTransactionalDataRegion.java:127)
      at org.hibernate.cache.ehcache.internal.strategy.ReadOnlyEhcacheEntityRegionAccessStrategy.get(ReadOnlyEhcacheEntityRegionAccessStrategy.java:59)
      at org.hibernate.cache.ehcache.internal.nonstop.NonstopAwareEntityRegionAccessStrategy.get(NonstopAwareEntityRegionAccessStrategy.java:108)
      at org.hibernate.engine.internal.CacheHelper.fromSharedCache(CacheHelper.java:55)
      at org.hibernate.engine.internal.CacheHelper.fromSharedCache(CacheHelper.java:67)
      at org.hibernate.event.internal.DefaultLoadEventListener.loadFromSecondLevelCache(DefaultLoadEventListener.java:598)
      at org.hibernate.event.internal.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:452)
      at org.hibernate.event.internal.DefaultLoadEventListener.load(DefaultLoadEventListener.java:213)
      at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:275)
      at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:151)
      at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:1070)
      at org.hibernate.internal.SessionImpl.access$2000(SessionImpl.java:176)
      at org.hibernate.internal.SessionImpl$IdentifierLoadAccessImpl.load(SessionImpl.java:2551)
      at org.hibernate.internal.SessionImpl.get(SessionImpl.java:955)
      at cdot.base.HibernateProxy.load(HibernateProxy.java:458)
      at cdot.base.HibernateProxy.load(HibernateProxy.java:431)
      at cdot.base.HibernateProxy$$FastClassBySpringCGLIB$$3d33b231.invoke(&lt;generated&gt;)
      at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
      at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:649)
      at cdot.base.HibernateProxy$$EnhancerBySpringCGLIB$$a28fa869.load(&lt;generated&gt;)
      at cdot.base.HibernateDAO.findBusinessObject(HibernateDAO.java:150)
      at cdot.ctms.layer.services.weather.ccic.facade.CcicFacade.getRoadConditions(CcicFacade.java:278)
      at sun.reflect.GeneratedMethodAccessor158.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
      at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
      at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
      at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
      at com.sun.proxy.$Proxy114.getRoadConditions(Unknown Source)
      at cdot.ctms.layer.services.weather.route.facade.WeatherRouteFacade.getWeatherSourceDTOList(WeatherRouteFacade.java:998)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
      at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
      at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
      at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
      at com.sun.proxy.$Proxy115.getWeatherSourceDTOList(Unknown Source)
      at cdot.ctms.layer.delegate.controllers.WeatherRouteController.getAllEnabledWeatherRouteRoadConditions(WeatherRouteController.java:300)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at cdot.ctms.layer.delegate.facade.AnnotationDelegateController.executeInternal(AnnotationDelegateController.java:287)
      at cdot.ctms.layer.delegate.facade.AnnotationDelegateController.processAction(AnnotationDelegateController.java:232)
      at springboot.config.web.RemotingConfig$AuthenticatingDelegateServiceWrapper.processAction(RemotingConfig.java:151)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
      at org.springframework.remoting.support.RemoteInvocationTraceInterceptor.invoke(RemoteInvocationTraceInterceptor.java:78)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
      at com.sun.proxy.$Proxy197.processAction(Unknown Source)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.springframework.remoting.support.RemoteInvocation.invoke(RemoteInvocation.java:212)
      at org.springframework.security.remoting.rmi.ContextPropagatingRemoteInvocation.invoke(ContextPropagatingRemoteInvocation.java:113)
      at org.springframework.remoting.support.DefaultRemoteInvocationExecutor.invoke(DefaultRemoteInvocationExecutor.java:39)
      at org.springframework.remoting.support.RemoteInvocationBasedExporter.invoke(RemoteInvocationBasedExporter.java:78)
      at org.springframework.remoting.rmi.RmiBasedExporter.invoke(RmiBasedExporter.java:73)
      at org.springframework.remoting.rmi.RmiInvocationWrapper.invoke(RmiInvocationWrapper.java:74)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
      at sun.rmi.transport.Transport$1.run(Unknown Source)
      at sun.rmi.transport.Transport$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Unknown Source)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
  Caused by: net.sf.ehcache.transaction.TransactionTimeoutException: transaction timed out
      at net.sf.ehcache.transaction.xa.XATransactionStore.assertNotTimedOut(XATransactionStore.java:278)
      at net.sf.ehcache.transaction.xa.XATransactionStore.getFromUnderlyingStore(XATransactionStore.java:393)
      at net.sf.ehcache.transaction.xa.XATransactionStore.get(XATransactionStore.java:304)
      at net.sf.ehcache.store.AbstractCopyingCacheStore.get(AbstractCopyingCacheStore.java:95)
      at net.sf.ehcache.store.TxCopyingCacheStore.get(TxCopyingCacheStore.java:33)
      at net.sf.ehcache.Cache.get(Cache.java:1734)
      at org.hibernate.cache.ehcache.internal.regions.EhcacheTransactionalDataRegion.get(EhcacheTransactionalDataRegion.java:112)
      ... 91 more
  </code></pre>