IDEMPIERE-2756 Background threads losing context when user log out - fix validation / integrate fix from hengsin: Allow null context parameter for PO. Run pipodictionaryservice as system client ( ad_client_id=0 ).

This commit is contained in:
Carlos Ruiz 2015-10-14 20:24:44 -05:00
parent c6bf87ef05
commit 6522a64289
2 changed files with 4 additions and 3 deletions

View File

@ -186,9 +186,7 @@ public abstract class PO
*/ */
public PO (Properties ctx, int ID, String trxName, ResultSet rs) public PO (Properties ctx, int ID, String trxName, ResultSet rs)
{ {
if (ctx == null) p_ctx = ctx != null ? ctx : Env.getCtx();
throw new IllegalArgumentException ("No Context");
p_ctx = ctx;
m_trxName = trxName; m_trxName = trxName;
p_info = initPO(ctx); p_info = initPO(ctx);

View File

@ -59,6 +59,9 @@ public class PipoDictionaryService implements IDictionaryService {
packIn = new PackIn(); packIn = new PackIn();
packIn.setPackageName(context.getBundle().getSymbolicName()); packIn.setPackageName(context.getBundle().getSymbolicName());
if (Env.getCtx().getProperty("#AD_Client_ID") == null) {
Env.getCtx().put("#AD_Client_ID", 0);
}
//get package version from file name suffix or bundle header //get package version from file name suffix or bundle header
String packageVersion = null; String packageVersion = null;
String fileName = packageFile.getName(); String fileName = packageFile.getName();