* Don't forget to release the RequestEvaluator after all is done.
This commit is contained in:
parent
86aedcff1e
commit
80740b46a4
1 changed files with 8 additions and 3 deletions
|
@ -653,7 +653,11 @@ public class ApplicationBean implements Serializable {
|
||||||
Object[] args, long timeout)
|
Object[] args, long timeout)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
RequestEvaluator reval = app.getEvaluator();
|
RequestEvaluator reval = app.getEvaluator();
|
||||||
return reval.invokeInternal(thisObject, function, args, timeout);
|
try {
|
||||||
|
return reval.invokeInternal(thisObject, function, args, timeout);
|
||||||
|
} finally {
|
||||||
|
app.releaseEvaluator(reval);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -704,17 +708,18 @@ public class ApplicationBean implements Serializable {
|
||||||
final Object function,
|
final Object function,
|
||||||
final Object[] args,
|
final Object[] args,
|
||||||
final long timeout) {
|
final long timeout) {
|
||||||
final RequestEvaluator reval = app.getEvaluator();
|
|
||||||
final SystemMap map = new SystemMap();
|
final SystemMap map = new SystemMap();
|
||||||
map.put("running", Boolean.TRUE);
|
|
||||||
new Thread() {
|
new Thread() {
|
||||||
public void run() {
|
public void run() {
|
||||||
|
RequestEvaluator reval = app.getEvaluator();
|
||||||
|
map.put("running", Boolean.TRUE);
|
||||||
try {
|
try {
|
||||||
map.put("result", reval.invokeInternal(thisObject, function, args, timeout));
|
map.put("result", reval.invokeInternal(thisObject, function, args, timeout));
|
||||||
} catch (Exception x) {
|
} catch (Exception x) {
|
||||||
map.put("exception", x);
|
map.put("exception", x);
|
||||||
} finally {
|
} finally {
|
||||||
map.put("running", Boolean.FALSE);
|
map.put("running", Boolean.FALSE);
|
||||||
|
app.releaseEvaluator(reval);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.start();
|
}.start();
|
||||||
|
|
Loading…
Add table
Reference in a new issue