struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hus...@apache.org
Subject svn commit: r517424 - /struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/interceptor/TokenSessionStoreInterceptor.java
Date Mon, 12 Mar 2007 22:18:45 GMT
Author: husted
Date: Mon Mar 12 15:18:44 2007
New Revision: 517424

URL: http://svn.apache.org/viewvc?view=rev&rev=517424
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/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/interceptor/TokenSessionStoreInterceptor.java

Modified: struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/interceptor/TokenSessionStoreInterceptor.java
URL: http://svn.apache.org/viewvc/struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/interceptor/TokenSessionStoreInterceptor.java?view=diff&rev=517424&r1=517423&r2=517424
==============================================================================
--- struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/interceptor/TokenSessionStoreInterceptor.java
(original)
+++ struts/struts2/branches/STRUTS_2_0_X/core/src/main/java/org/apache/struts2/interceptor/TokenSessionStoreInterceptor.java
Mon Mar 12 15:18:44 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



Mime
View raw message