Why did my Groovy expression time out?
In general, avoid writing Groovy scripts that might require more than 60 seconds to complete.
A timeout of 60,000 milliseconds (60 seconds) is
configured for Groovy expressions. If the expression requires more
than 60 seconds to complete, an expression timeout (oracle.jbo.ExprTimeoutException
) occurs and
an error message is displayed.
For example:
Exception in expression "<object name>" object function <function name> : oracle.jbo.ExprTimeoutException Expression timed out. at "<object name>" object function <function name> line <line number>
The location where the error message is displayed depends on where the Groovy expression was executed.
If the Groovy expression is executed as a result of... |
The error message appears in... |
---|---|
A UI operation |
The UI. |
A Web service update |
The Web service client. |
A workflow invocation |
The error message is hidden from the end user. |
Common situations where the Groovy expression timeout might be encountered include:
-
If the Groovy expression attempts to iterate over a large collection of records, a Groovy timeout error might occur. In such a situation, any records that were initially modified are not actually committed.
For example, let's say that the following expression times out:
def vo=newView('TestCO_c') vo.executeQuery() while(vo.hasNext()){ def curRow=vo.next() curRow.setAttribute('F1_c',curRow.RecordName) println(curRow.RecordName+":" + result) }
Inspection of the
println
statements reveals that thesetAttribute()
operation was performed on a few records. However, if the timeout occurs while the Groovy execution is still in progress, none of the changes made are committed.
-
If the Groovy expression calls a Web service, and if the Web service operation takes more than 60 seconds, a Groovy timeout error might occur. However, because the commit is part of the Web service, the commit will occur after the Web service operation is completed.
def response=adf.webServices.WS.Operation(<payload>);