IDEMPIERE-2944 Preserve iDempiere session between sucessive webservice calls / found the previous sessions was not being closed properly

This commit is contained in:
Carlos Ruiz 2018-07-27 11:36:11 +02:00
parent 4c644268e1
commit 48b927327a
1 changed files with 19 additions and 5 deletions

View File

@ -471,11 +471,25 @@ public class CompiereService {
);
if (m_connected && expired)
{
if (log.isLoggable(Level.INFO)) log.info("Closing expired/invalid " + this);
Env.logout();
ServerContext.dispose();
m_loggedin = false;
m_connected = false;
synchronized (csMap) {
String key = getKey(m_AD_Client_ID,
m_AD_Org_ID,
m_userName,
m_AD_Role_ID,
m_M_Warehouse_ID,
m_locale,
m_password,
m_IPAddress);
if (ctxMap.containsKey(key)) {
Properties cachedCtx = ctxMap.get(key);
Env.getCtx().putAll(cachedCtx);
}
if (log.isLoggable(Level.INFO)) log.info("Closing expired/invalid " + this);
Env.logout();
ServerContext.dispose();
m_loggedin = false;
m_connected = false;
}
}
return expired;
}