diff --git a/dbPort/src/org/compiere/util/Env.java b/dbPort/src/org/compiere/util/Env.java index e429948061..4462bb6f4b 100644 --- a/dbPort/src/org/compiere/util/Env.java +++ b/dbPort/src/org/compiere/util/Env.java @@ -47,10 +47,13 @@ public final class Env */ public static void exitEnv (int status) { - // End Session - MSession session = MSession.get(Env.getCtx(), false); // finish - if (session != null) - session.logout(); + //hengsin, avoid unncessary query of session when exit without log in + if (DB.isConnected(false)) { + // End Session + MSession session = MSession.get(Env.getCtx(), false); // finish + if (session != null) + session.logout(); + } // reset(true); // final cache reset s_log.info("");