diff options
author | Artur Signell <artur@vaadin.com> | 2012-11-29 18:28:14 +0200 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2012-11-29 18:28:14 +0200 |
commit | c2b7aad4b62be9c807cd3c08f0c3d6ad72f4f1c6 (patch) | |
tree | 61db770f12b3b4f308c85b783acfb9e91dffeda5 /server | |
parent | cfb2513cd2049d6cae90b6d2c725a03e75194ce9 (diff) | |
download | vaadin-framework-c2b7aad4b62be9c807cd3c08f0c3d6ad72f4f1c6.tar.gz vaadin-framework-c2b7aad4b62be9c807cd3c08f0c3d6ad72f4f1c6.zip |
Made session reinitializing work again (#10411)
Change-Id: I012a5154fa3cf0bba6f3289213744b740cf12059
Diffstat (limited to 'server')
-rw-r--r-- | server/src/com/vaadin/server/VaadinService.java | 7 | ||||
-rw-r--r-- | server/src/com/vaadin/server/VaadinSession.java | 6 |
2 files changed, 7 insertions, 6 deletions
diff --git a/server/src/com/vaadin/server/VaadinService.java b/server/src/com/vaadin/server/VaadinService.java index 5338ec217b..6794be4dbd 100644 --- a/server/src/com/vaadin/server/VaadinService.java +++ b/server/src/com/vaadin/server/VaadinService.java @@ -47,7 +47,7 @@ import com.vaadin.util.ReflectTools; * @since 7.0 */ public abstract class VaadinService implements Serializable { - private static final String REINITIALIZING_SESSION_MARKER = VaadinService.class + static final String REINITIALIZING_SESSION_MARKER = VaadinService.class .getName() + ".reinitializing"; private static final Method SESSION_INIT_METHOD = ReflectTools.findMethod( @@ -329,11 +329,6 @@ public abstract class VaadinService implements Serializable { } public void fireSessionDestroy(VaadinSession vaadinSession) { - // Ignore if the session is being moved to a different backing session - if (vaadinSession.getAttribute(REINITIALIZING_SESSION_MARKER) == Boolean.TRUE) { - return; - } - for (UI ui : new ArrayList<UI>(vaadinSession.getUIs())) { // close() called here for consistency so that it is always called // before a UI is removed. UI.isClosing() is thus always true in diff --git a/server/src/com/vaadin/server/VaadinSession.java b/server/src/com/vaadin/server/VaadinSession.java index 4aa2ef5d92..18db4127f4 100644 --- a/server/src/com/vaadin/server/VaadinSession.java +++ b/server/src/com/vaadin/server/VaadinSession.java @@ -162,6 +162,12 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { + "This might happen if a session is deserialized but never used before it expires."); } else if (VaadinService.getCurrentRequest() != null && getCurrent() == this) { + // Ignore if the session is being moved to a different backing + // session + if (getAttribute(VaadinService.REINITIALIZING_SESSION_MARKER) == Boolean.TRUE) { + return; + } + // There is still a request in progress for this session. The // session will be destroyed after the response has been written. if (!isClosing()) { |