Need locking when call VaadinSession getAttribute in Vaadin 7
问题 I know that it is necessary when call setAttribute (link), but what about getAttirbute? Is this correct? public Object getMyAttribute() { return VaadinSession.getCurrent().getAttribute("myAttribute"); } Or need locking? public Object getMyAttribute() { try { VaadinSession.getCurrent().getLockInstance().lock(); return VaadinSession.getCurrent().getAttribute("myAttribute"); } finally { VaadinSession.getCurrent().getLockInstance().unlock(); } } 回答1: Adding to the answer by Patton. While I'm not