IDEMPIERE-2756 Background threads losing context when user log out

This commit is contained in:
Carlos Ruiz 2015-08-07 16:48:18 -05:00
parent ad6290e09c
commit b1c16a2441
1 changed files with 4 additions and 7 deletions

View File

@ -66,13 +66,10 @@ public class LoggedSessionListener implements HttpSessionListener, ServletContex
} }
public void removeADSession(String sessionID, String serverName) { public void removeADSession(String sessionID, String serverName) {
String whereClause = "WebSession=? AND ServerName=? AND Processed='N'"; String sql = "UPDATE AD_Session SET Processed='Y' WHERE WebSession=? AND ServerName=? AND Processed='N'";
List<MSession> sessions = new Query(Env.getCtx(), MSession.Table_Name, whereClause, null) int no = DB.executeUpdate(sql, new Object[] {sessionID, serverName}, false, null);
.setParameters(sessionID, serverName) if (no < 0) {
.list(); throw new AdempiereException("UpdateSession: Cannot Destroy Session");
for (MSession session : sessions) {
session.setProcessed(true);
session.saveEx();
} }
} }