aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/main/java/com/vaadin
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/main/java/com/vaadin')
-rw-r--r--server/src/main/java/com/vaadin/server/VaadinService.java18
1 files changed, 14 insertions, 4 deletions
diff --git a/server/src/main/java/com/vaadin/server/VaadinService.java b/server/src/main/java/com/vaadin/server/VaadinService.java
index 888b82a3cb..25354074e1 100644
--- a/server/src/main/java/com/vaadin/server/VaadinService.java
+++ b/server/src/main/java/com/vaadin/server/VaadinService.java
@@ -1156,8 +1156,13 @@ public abstract class VaadinService implements Serializable {
if (value instanceof VaadinSession) {
// set flag to avoid cleanup
VaadinSession serviceSession = (VaadinSession) value;
- serviceSession.setAttribute(PRESERVE_UNBOUND_SESSION_ATTRIBUTE,
- Boolean.TRUE);
+ serviceSession.lock();
+ try {
+ serviceSession.setAttribute(
+ PRESERVE_UNBOUND_SESSION_ATTRIBUTE, Boolean.TRUE);
+ } finally {
+ serviceSession.unlock();
+ }
}
attrs.put(name, value);
}
@@ -1183,8 +1188,13 @@ public abstract class VaadinService implements Serializable {
serviceSession.getLockInstance());
service.storeSession(serviceSession, newSession);
- serviceSession.setAttribute(PRESERVE_UNBOUND_SESSION_ATTRIBUTE,
- null);
+ serviceSession.lock();
+ try {
+ serviceSession.setAttribute(
+ PRESERVE_UNBOUND_SESSION_ATTRIBUTE, null);
+ } finally {
+ serviceSession.unlock();
+ }
}
}