incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r591964 - /incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/servlet/MicroslingMainServlet.java
Date Mon, 05 Nov 2007 11:34:32 GMT
Author: fmeschbe
Date: Mon Nov  5 03:34:29 2007
New Revision: 591964

URL: http://svn.apache.org/viewvc?rev=591964&view=rev
Log:
Ensure the JCR Session is logged out after request processing

Modified:
    incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/servlet/MicroslingMainServlet.java

Modified: incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/servlet/MicroslingMainServlet.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/servlet/MicroslingMainServlet.java?rev=591964&r1=591963&r2=591964&view=diff
==============================================================================
--- incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/servlet/MicroslingMainServlet.java
(original)
+++ incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/servlet/MicroslingMainServlet.java
Mon Nov  5 03:34:29 2007
@@ -166,14 +166,25 @@
         }
 
         Session session = authenticate(req);
+        try {
 
-        MicroslingSlingHttpServletRequest request = new MicroslingSlingHttpServletRequest(
-            hReq, session, serviceLocator);
-        MicroslingSlingHttpServletResponse response = new MicroslingSlingHttpServletResponse(
-            hRes);
+            MicroslingSlingHttpServletRequest request = new MicroslingSlingHttpServletRequest(
+                hReq, session, serviceLocator);
+            MicroslingSlingHttpServletResponse response = new MicroslingSlingHttpServletResponse(
+                hRes);
+
+            // our filters might need the SlingRequestContext to store info in it
+            filterChain.service(request, response);
+
+        } finally {
+            try {
+                session.logout();
+            } catch (Throwable t) {
+                log.error(
+                    "service: Unexpected Problem logging out JCR Session", t);
+            }
+        }
 
-        // our filters might need the SlingRequestContext to store info in it
-        filterChain.service(request, response);
     }
 
     @Override



Mime
View raw message