Commit 79cd439c1a3287258efddf5311539429a93963c3
1 parent
d20b49c0
Sincronizando trecho de código na sessão ao invés de sincronizar em
objeto com escopo de aplicação.
Showing
1 changed file
with
2 additions
and
4 deletions
Show diff stats
impl/extension/jsf/src/main/java/br/gov/frameworkdemoiselle/internal/context/FacesViewContextImpl.java
| ... | ... | @@ -95,7 +95,7 @@ public class FacesViewContextImpl extends AbstractCustomContext implements ViewC |
| 95 | 95 | // em um trecho sincronizado para criar a store de forma atômica. |
| 96 | 96 | FacesViewBeanStore currentStore = (FacesViewBeanStore) session.getAttribute(VIEW_STORE_KEY); |
| 97 | 97 | if (currentStore==null){ |
| 98 | - synchronized (this) { | |
| 98 | + synchronized (session) { | |
| 99 | 99 | currentStore = (FacesViewBeanStore) session.getAttribute(VIEW_STORE_KEY); |
| 100 | 100 | if (currentStore==null){ |
| 101 | 101 | currentStore = new FacesViewBeanStore(); |
| ... | ... | @@ -111,7 +111,7 @@ public class FacesViewContextImpl extends AbstractCustomContext implements ViewC |
| 111 | 111 | if (viewId==null){ |
| 112 | 112 | Map<String, Object> facesViewMap = Faces.getViewMap(); |
| 113 | 113 | |
| 114 | - synchronized (currentStore) { | |
| 114 | + synchronized (session) { | |
| 115 | 115 | |
| 116 | 116 | //Tenta obte-lo novamente, caso entre a primeira tentativa e o bloqueio |
| 117 | 117 | //da thread outra thread já tenha criado o número. |
| ... | ... | @@ -123,8 +123,6 @@ public class FacesViewContextImpl extends AbstractCustomContext implements ViewC |
| 123 | 123 | } |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | - | |
| 127 | - | |
| 128 | 126 | return currentStore.getStore(viewId, this); |
| 129 | 127 | } |
| 130 | 128 | ... | ... |