From 4f59be659743f04f09e934824a7b305a27b440a6 Mon Sep 17 00:00:00 2001 From: hns Date: Wed, 23 Mar 2005 12:28:26 +0000 Subject: [PATCH] * Move initScriptingEngine() and scriptingEngine.updatePrototypes() call inside try statement * Replace do.. while with wile statement --- .../framework/core/RequestEvaluator.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/helma/framework/core/RequestEvaluator.java b/src/helma/framework/core/RequestEvaluator.java index 2215cfc1..636a9b27 100644 --- a/src/helma/framework/core/RequestEvaluator.java +++ b/src/helma/framework/core/RequestEvaluator.java @@ -121,11 +121,9 @@ public final class RequestEvaluator implements Runnable { Transactor localrtx = (Transactor) Thread.currentThread(); try { - do { // while (localrtx == rtx); - // initialize scripting engine, in case it hasn't been initialized yet - initScriptingEngine(); - // update scripting prototypes - scriptingEngine.updatePrototypes(); + + // while this thread is serving requests + while (localrtx == rtx) { // root object reference Object root; @@ -145,6 +143,11 @@ public final class RequestEvaluator implements Runnable { try { + // initialize scripting engine + initScriptingEngine(); + // update scripting prototypes + scriptingEngine.updatePrototypes(); + // Transaction name is used for logging etc. StringBuffer txname = new StringBuffer(app.getName()); txname.append(":").append(req.getMethod().toLowerCase()).append(":"); @@ -516,8 +519,8 @@ public final class RequestEvaluator implements Runnable { app.errorCount += 1; app.logError("Error in " + Thread.currentThread(), x); - // Dump the profiling data to System.err - if (app.debug && !(x instanceof ScriptingException)) { + // Dump stack trace to System.err in debug mode + if (app.debug) { x.printStackTrace(); } @@ -545,7 +548,7 @@ public final class RequestEvaluator implements Runnable { notifyAndWait(); - } while (localrtx == rtx); + } } finally { localrtx.closeConnections();