You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by st...@apache.org on 2015/05/06 15:22:15 UTC

svn commit: r1677983 - /openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java

Author: struberg
Date: Wed May  6 13:22:14 2015
New Revision: 1677983

URL: http://svn.apache.org/r1677983
Log:
OWB-1048 only postpone session destroyal if the request is really a servlet request

We do NOT postpone the session destroyal if the destroySessionContext only got
triggered by a session eviction timeout

Modified:
    openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java

Modified: openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java?rev=1677983&r1=1677982&r2=1677983&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java (original)
+++ openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java Wed May  6 13:22:14 2015
@@ -373,7 +373,8 @@ public class WebContextsService extends
 
         if (context.getPropagatedSessionContext() != null)
         {
-            context.destroy();
+            SessionContext sessionContext = context.getPropagatedSessionContext();
+            sessionContext.destroy();
 
             Object payload = null;
             if (context.getServletRequest() != null)
@@ -497,7 +498,8 @@ public class WebContextsService extends
             // we need to mark the conversation to get destroyed at the end of the request
             ServletRequestContext requestContext = getRequestContext(true);
 
-            if (destroySessionImmediately || requestContext == null)
+            if (destroySessionImmediately || requestContext == null
+                    || requestContext.getServletRequest() == null || requestContext.getServletRequest().getSession() == null)
             {
                 context.destroy();
                 webBeansContext.getBeanManagerImpl().fireEvent(session != null ? session : new Object(), DestroyedLiteral.INSTANCE_SESSION_SCOPED);