diff --git a/org.adempiere.base/src/org/compiere/process/SvrProcess.java b/org.adempiere.base/src/org/compiere/process/SvrProcess.java index 67ca51f844..deb3c2430f 100644 --- a/org.adempiere.base/src/org/compiere/process/SvrProcess.java +++ b/org.adempiere.base/src/org/compiere/process/SvrProcess.java @@ -563,8 +563,13 @@ public abstract class SvrProcess implements ProcessCall */ private void unlock () { + boolean noContext = Env.getCtx().isEmpty() && Env.getCtx().getProperty("#AD_Client_ID") == null; try { + //save logging info even if context is lost + if (noContext) + Env.getCtx().put("#AD_Client_ID", m_pi.getAD_Client_ID()); + MPInstance mpi = new MPInstance (getCtx(), m_pi.getAD_PInstance_ID(), null); if (mpi.get_ID() == 0) { @@ -583,6 +588,11 @@ public abstract class SvrProcess implements ProcessCall { log.severe("unlock() - " + e.getLocalizedMessage()); } + finally + { + if (noContext) + Env.getCtx().remove("#AD_Client_ID"); + } } // unlock /**