Author: struberg
Date: Thu Aug  2 21:00:36 2012
New Revision: 1368702

URL: http://svn.apache.org/viewvc?rev=1368702&view=rev
Log:
OWB-690 fix ThreadLocal cleanup in WebContextsService

Thanks to thomas andraschko for catching this issue.

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=1368702&r1=1368701&r2=1368702&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
 Thu Aug  2 21:00:36 2012
@@ -395,18 +395,8 @@ public class WebContextsService extends 
         //Clear thread locals
         requestContexts.set(null);
         requestContexts.remove();
-        
-        //Also clear application and singleton context
-        applicationContexts.set(null);
-        applicationContexts.remove();
-        
-        //Singleton context
-        singletonContexts.set(null);
-        singletonContexts.remove();
-        
-        //Conversation context
-        conversationContexts.set(null);
-        conversationContexts.remove();
+
+        RequestScopedBeanInterceptorHandler.removeThreadLocals();
     }
 
     private void cleanupConversations()
@@ -581,6 +571,10 @@ public class WebContextsService extends 
         
         //destroyDependents all conversations
         conversationManager.destroyAllConversations();
+
+        //Also clear application and singleton context
+        applicationContexts.set(null);
+        applicationContexts.remove();
     }
     
     /**
@@ -641,7 +635,11 @@ public class WebContextsService extends 
         if(servletContext != null)
         {
             currentSingletonContexts.remove(servletContext);   
-        }                
+        }
+
+        //Singleton context
+        singletonContexts.set(null);
+        singletonContexts.remove();
     }
 
     /**


Reply via email to