1. opensymphony
  2. oscache

Commits

ha...@81dbac14-341a-0410-aa85-cbcd92e6f43e  committed 9268002

never create a session for an app scope cache

  • Participants
  • Parent commits 90fe191
  • Branches default

Comments (0)

Files changed (1)

File src/core/java/com/opensymphony/oscache/web/ServletCacheAdministrator.java

View file
  • Ignore whitespace
     */
     private Map flushTimes;
 
+    /**
+     * Required so we can look up the app scope cache without forcing a session creation.
+     */
+    private transient ServletContext context;
+
     //private transient ServletContext context;
 
     /**
         //this.context = context;
         flushTimes = new HashMap();
         initHostDomainInKey();
+        this.context = context;
     }
 
     /**
             admin.getAppScopeCache(context);
         }
 
+        if (admin.context == null) {
+            admin.context = context;
+        }
+
         return admin;
     }
 
     */
     public Cache getCache(HttpServletRequest request, int scope) {
         if (scope == PageContext.APPLICATION_SCOPE) {
-            return getAppScopeCache(request.getSession(true).getServletContext());
+            return getAppScopeCache(context);
         }
 
         if (scope == PageContext.SESSION_SCOPE) {