IDEMPIERE-2756 Background threads losing context when user log out
This commit is contained in:
parent
ad6290e09c
commit
b1c16a2441
|
@ -66,13 +66,10 @@ public class LoggedSessionListener implements HttpSessionListener, ServletContex
|
|||
}
|
||||
|
||||
public void removeADSession(String sessionID, String serverName) {
|
||||
String whereClause = "WebSession=? AND ServerName=? AND Processed='N'";
|
||||
List<MSession> sessions = new Query(Env.getCtx(), MSession.Table_Name, whereClause, null)
|
||||
.setParameters(sessionID, serverName)
|
||||
.list();
|
||||
for (MSession session : sessions) {
|
||||
session.setProcessed(true);
|
||||
session.saveEx();
|
||||
String sql = "UPDATE AD_Session SET Processed='Y' WHERE WebSession=? AND ServerName=? AND Processed='N'";
|
||||
int no = DB.executeUpdate(sql, new Object[] {sessionID, serverName}, false, null);
|
||||
if (no < 0) {
|
||||
throw new AdempiereException("UpdateSession: Cannot Destroy Session");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue