Source

scm-manager / scm-plugin-backend / src / main / resources / config / ehcache.xml

Diff from to

File scm-plugin-backend/src/main/resources/config/ehcache.xml

         timeToLiveSeconds="3600"
         diskPersistent="false"
   />
+  
+  <!-- shiro -->
+  
+  <!-- We want eternal="true" and no timeToIdle or timeToLive settings because Shiro manages session
+       expirations explicitly.  If we set it to false and then set corresponding timeToIdle and timeToLive properties,
+       ehcache would evict sessions without Shiro's knowledge, which would cause many problems
+      (e.g. "My Shiro session timeout is 30 minutes - why isn't a session available after 2 minutes?"
+             Answer - ehcache expired it due to the timeToIdle property set to 120 seconds.)
+
+      diskPersistent=true since we want an enterprise session management feature - ability to use sessions after
+      even after a JVM restart.  -->
+  <cache name="shiro-activeSessionCache"
+         maxElementsInMemory="10000"
+         overflowToDisk="true"
+         eternal="true"
+         timeToLiveSeconds="0"
+         timeToIdleSeconds="0"
+         diskPersistent="true"
+         diskExpiryThreadIntervalSeconds="600"
+  />
+
+  <cache name="org.apache.shiro.realm.text.PropertiesRealm-0-accounts"
+         maxElementsInMemory="1000"
+         eternal="true"
+         overflowToDisk="true"
+  />
 
 </ehcache>