* Move initScriptingEngine() and scriptingEngine.updatePrototypes() call inside try statement
* Replace do.. while with wile statement
This commit is contained in:
parent
14f8f1e8d2
commit
4f59be6597
1 changed files with 11 additions and 8 deletions
|
@ -121,11 +121,9 @@ public final class RequestEvaluator implements Runnable {
|
||||||
Transactor localrtx = (Transactor) Thread.currentThread();
|
Transactor localrtx = (Transactor) Thread.currentThread();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
do { // while (localrtx == rtx);
|
|
||||||
// initialize scripting engine, in case it hasn't been initialized yet
|
// while this thread is serving requests
|
||||||
initScriptingEngine();
|
while (localrtx == rtx) {
|
||||||
// update scripting prototypes
|
|
||||||
scriptingEngine.updatePrototypes();
|
|
||||||
|
|
||||||
// root object reference
|
// root object reference
|
||||||
Object root;
|
Object root;
|
||||||
|
@ -145,6 +143,11 @@ public final class RequestEvaluator implements Runnable {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
// initialize scripting engine
|
||||||
|
initScriptingEngine();
|
||||||
|
// update scripting prototypes
|
||||||
|
scriptingEngine.updatePrototypes();
|
||||||
|
|
||||||
// Transaction name is used for logging etc.
|
// Transaction name is used for logging etc.
|
||||||
StringBuffer txname = new StringBuffer(app.getName());
|
StringBuffer txname = new StringBuffer(app.getName());
|
||||||
txname.append(":").append(req.getMethod().toLowerCase()).append(":");
|
txname.append(":").append(req.getMethod().toLowerCase()).append(":");
|
||||||
|
@ -516,8 +519,8 @@ public final class RequestEvaluator implements Runnable {
|
||||||
app.errorCount += 1;
|
app.errorCount += 1;
|
||||||
app.logError("Error in " + Thread.currentThread(), x);
|
app.logError("Error in " + Thread.currentThread(), x);
|
||||||
|
|
||||||
// Dump the profiling data to System.err
|
// Dump stack trace to System.err in debug mode
|
||||||
if (app.debug && !(x instanceof ScriptingException)) {
|
if (app.debug) {
|
||||||
x.printStackTrace();
|
x.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -545,7 +548,7 @@ public final class RequestEvaluator implements Runnable {
|
||||||
|
|
||||||
notifyAndWait();
|
notifyAndWait();
|
||||||
|
|
||||||
} while (localrtx == rtx);
|
}
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
localrtx.closeConnections();
|
localrtx.closeConnections();
|
||||||
|
|
Loading…
Add table
Reference in a new issue