9 Post-Execution Debugging of MLE JavaScript Modules
The ability to easily debug code is central to a good developer experience. MLE provides the option to perform post-execution debugging on your JavaScript source code in addition to standard print debugging.
Post-execution debugging allows efficient collection of runtime state during program execution. Once execution of the code has completed, the collected data can be used to analyze program behavior and discover bugs that require attention. To perform post-execution debugging, you provide a debug specification that identifies the debugging information to be collected. A debug specification is a collection of debugpoints, each of which specify a location in the source code where debug information should be collected, as well as what information to collect. Debugpoints can be conditional or unconditional.
Note:
Post-execution debugging can only be applied to JavaScript code that is deployed as MLE modules. This debugging feature cannot currently be used when deploying code via dynamic execution.Note:
MLE built-in modules such as the MLE JavaScript driver and MLE bindings cannot be debugged via
post-execution debugging. An attempt to debug a built-in module will cause an
ORA-04162
error to be raised.
For more information about MLE built-in modules, see Server-Side JavaScript API Documentation.
Module debugpoints apply to all executions of the module code, including via MLE call specifications, as well as via module import, whether from a dynamic MLE source or from another MLE module. Once enabled, a debug specification is active either until it is disabled or replaced by a new debug specification, or until the session ends.
Topics
- Specifying Debugpoints
Debugpoints are specified using a JSON document encoded in the database character set. - Managing Debugpoints
Debugging can be enabled in a session by calling the proceduredbms_mle.enable_debugging
with a debug specification. - Analyzing Debug Output
Output from debugpoints is stored in the Java Profiler Heap Dump version 1.0.2 format. - Error Handling in MLE
Errors encountered during the execution of MLE JavaScript code are reported as database errors.