You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by rm...@apache.org on 2015/03/05 17:28:35 UTC

svn commit: r1664392 - /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java

Author: rmannibucau
Date: Thu Mar  5 16:28:34 2015
New Revision: 1664392

URL: http://svn.apache.org/r1664392
Log:
ensure to get a session id for not transient conversations

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java?rev=1664392&r1=1664391&r2=1664392&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java Thu Mar  5 16:28:34 2015
@@ -141,6 +141,7 @@ public class ConversationImpl implements
         {
             isTransient = false;
             id = Integer.toString(conversationIdGenerator.incrementAndGet());
+            ensureSessionId();
             iUseIt();
             updateTimeOut();
 
@@ -210,20 +211,25 @@ public class ConversationImpl implements
             isTransient = false;
             this.id = id;
             iUseIt();
-            if (this.sessionId == null)
-            {
-                OpenWebBeansWebPlugin web = webBeansContext.getPluginLoader().getWebPlugin();
-                if (web != null)
-                {
-                    this.sessionId = web.currentSessionId();
-                }
-            }
+            ensureSessionId();
             updateTimeOut();
 
             conversationManager.addConversationContext(this, getOrStartConversationScope());
         }
     }
-    
+
+    private void ensureSessionId()
+    {
+        if (this.sessionId == null)
+        {
+            OpenWebBeansWebPlugin web = webBeansContext.getPluginLoader().getWebPlugin();
+            if (web != null)
+            {
+                this.sessionId = web.currentSessionId();
+            }
+        }
+    }
+
     /**
      * {@inheritDoc}
      */