IDEMPIERE-5654 - UnMark flag isProcessing in AD_PInstance table after start server (#1758)

This commit is contained in:
Jose Leite 2023-03-30 10:57:23 -03:00 committed by GitHub
parent 74b038436b
commit d01555fa08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -119,11 +119,16 @@ public class LoggedSessionListener implements HttpSessionListener, ServletContex
}
String serverName = WebUtil.getServerName();
String sql = "UPDATE AD_Session SET Processed='Y' WHERE Processed='N' AND ServerName=?";
final String sql = "UPDATE AD_Session SET Processed='Y' WHERE Processed='N' AND ServerName=?";
int no = DB.executeUpdate(sql, new Object[] {serverName}, false, null);
if (no < 0) {
throw new AdempiereException("UpdateSession: Cannot Destroy All Session");
}
final String sqlp = "UPDATE AD_PInstance SET IsProcessing='N' WHERE IsProcessing='Y' AND EXISTS (SELECT 1 FROM AD_Session s WHERE s.AD_Session_ID=AD_PInstance.AD_Session_ID AND s.ServerName=?)";
int nop = DB.executeUpdate(sqlp, new Object[] {serverName}, false, null);
if (nop < 0) {
throw new AdempiereException("UpdateSession: Cannot Update All Process Instances");
}
Adempiere.removeServerStateChangeListener(this);
}