IDEMPIERE-5049 Zk Session and Desktop object not destroy immediately after logout (#997)
- Fix invalidation of session
This commit is contained in:
parent
06698688ef
commit
460a4798e9
|
@ -409,9 +409,6 @@ public class AdempiereWebUI extends Window implements EventListener<Event>, IWeb
|
||||||
public void logout()
|
public void logout()
|
||||||
{
|
{
|
||||||
final Desktop desktop = Executions.getCurrent().getDesktop();
|
final Desktop desktop = Executions.getCurrent().getDesktop();
|
||||||
if (desktop.isServerPushEnabled())
|
|
||||||
desktop.enableServerPush(false);
|
|
||||||
|
|
||||||
final WebApp wapp = desktop.getWebApp();
|
final WebApp wapp = desktop.getWebApp();
|
||||||
final DesktopCache desktopCache = ((WebAppCtrl) wapp).getDesktopCache(desktop.getSession());
|
final DesktopCache desktopCache = ((WebAppCtrl) wapp).getDesktopCache(desktop.getSession());
|
||||||
final Session session = logout0();
|
final Session session = logout0();
|
||||||
|
@ -438,7 +435,7 @@ public class AdempiereWebUI extends Window implements EventListener<Event>, IWeb
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
t.printStackTrace();
|
t.printStackTrace();
|
||||||
}
|
}
|
||||||
session.invalidate();
|
((SessionCtrl)session).invalidateNow();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -454,6 +451,8 @@ public class AdempiereWebUI extends Window implements EventListener<Event>, IWeb
|
||||||
|
|
||||||
//clear context, invalidate session
|
//clear context, invalidate session
|
||||||
Env.getCtx().clear();
|
Env.getCtx().clear();
|
||||||
|
SessionCtrl ctrl = (SessionCtrl) session;
|
||||||
|
if (!ctrl.isInvalidated() && session.getNativeSession() != null)
|
||||||
destroySession(session);
|
destroySession(session);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -105,12 +105,9 @@ public class DesktopWatchDog {
|
||||||
}
|
}
|
||||||
if (!toDestroy.isEmpty()) {
|
if (!toDestroy.isEmpty()) {
|
||||||
for(Session session : toDestroy) {
|
for(Session session : toDestroy) {
|
||||||
try {
|
if (!((SessionCtrl)session).isInvalidated()) {
|
||||||
((SessionCtrl)session).onDestroyed();
|
((SessionCtrl)session).invalidateNow();
|
||||||
} catch (Throwable t) {
|
|
||||||
t.printStackTrace();
|
|
||||||
}
|
}
|
||||||
session.invalidate();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue