Author: husted
Date: Mon Mar 12 15:22:12 2007
New Revision: 517426

URL: http://svn.apache.org/viewvc?view=rev&rev=517426
Log:
WW-1786 "using session-token interceptor generates FreeMarker template error" 
Apply patch submitted by Tom Schneider. The change synchronizes on the Ognl 
context so we don't concurrently execute results. The issue was that we were 
getting concurrency exceptions around the ognl context because the results were 
being executed concurrently. The change will reduce throughput when using the 
session-token interceptor, but it avoids the concurrency issues.

Modified:
    
struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/TokenSessionStoreInterceptor.java

Modified: 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/TokenSessionStoreInterceptor.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/TokenSessionStoreInterceptor.java?view=diff&rev=517426&r1=517425&r2=517426
==============================================================================
--- 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/TokenSessionStoreInterceptor.java
 (original)
+++ 
struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/TokenSessionStoreInterceptor.java
 Mon Mar 12 15:22:12 2007
@@ -123,12 +123,15 @@
             if (savedInvocation != null) {
                 // set the valuestack to the request scope
                 ValueStack stack = savedInvocation.getStack();
+                Map context = stack.getContext();
                 
request.setAttribute(ServletActionContext.STRUTS_VALUESTACK_KEY, stack);
 
                 Result result = savedInvocation.getResult();
 
                 if ((result != null) && 
(savedInvocation.getProxy().getExecuteResult())) {
-                    result.execute(savedInvocation);
+                    synchronized (context) {
+                        result.execute(savedInvocation);
+                    }
                 }
 
                 // turn off execution of this invocations result


Reply via email to