Author: ehillenius
Date: Tue Apr 24 15:46:41 2007
New Revision: 532124

URL: http://svn.apache.org/viewvc?view=rev&rev=532124
Log:
synchronize on method instead of this in order to support Terracotta.

Modified:
    
incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java

Modified: 
incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java?view=diff&rev=532124&r1=532123&r2=532124
==============================================================================
--- 
incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java
 (original)
+++ 
incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Session.java
 Tue Apr 24 15:46:41 2007
@@ -402,30 +402,25 @@
         * This method should not typically be called by clients
         * </p>
         */
-       public final void bind()
+       public synchronized final void bind()
        {
                ISessionStore store = getSessionStore();
                Request request = RequestCycle.get().getRequest();
                if (store.lookup(request) == null)
                {
-                       synchronized (this)
-                       {
-                               // explicitly create a session
-                               this.id = store.getSessionId(request, true);
-                               // bind it
-                               store.bind(request, this);
+                       // explicitly create a session
+                       this.id = store.getSessionId(request, true);
+                       // bind it
+                       store.bind(request, this);
 
-                               if (temporarySessionAttributes != null)
+                       if (temporarySessionAttributes != null)
+                       {
+                               for (Iterator i = 
temporarySessionAttributes.entrySet().iterator(); i.hasNext();)
                                {
-                                       for (Iterator i = 
temporarySessionAttributes.entrySet().iterator(); i.hasNext();)
-                                       {
-                                               Entry entry = (Entry)i.next();
-                                               store.setAttribute(request, 
String.valueOf(entry.getKey()), entry
-                                                               .getValue());
-                                       }
-                                       temporarySessionAttributes = null;
+                                       Entry entry = (Entry)i.next();
+                                       store.setAttribute(request, 
String.valueOf(entry.getKey()), entry.getValue());
                                }
-
+                               temporarySessionAttributes = null;
                        }
                }
                else


Reply via email to