XQuery database debugging

XQuery debugging is currently supported for the MarkLogic and Berkeley DB XML database engines.

Debugging with MarkLogic

To start a debug session against the MarkLogic engine you will first need to configure a MarkLogic datasource and a MarkLogic connection. Also you have to make sure that the debugging support is enabled in the MarkLogic server that will be accessed from <oXygen/>. On the server side debugging must be activated both in the XDBC server and in the section Task Server of the server control console (the switch debug allow) otherwise the error DBG-TASKDEBUGALLOW is reported by the MarkLogic server.

The MarkLogic XQuery debugger integrates seamlessly into the XQuery Debugger perspective. If you already have a MarkLogic scenario configured for the XQuery file you can choose directly to debug the scenario. If not, you just have to switch to the XQuery Debugger perspective, open the XQuery file in the editor and select the MarkLogic connection in the  XQuery engine selector from the debug control toolbar. For general information about how a debugging session is started and controlled see the working with the debugger section.

When debugging queries which import modules the recommended steps are as follows:

  • After starting the debugging session 'Step in' repeatedly until reaching the desired modules

  • Add each of the modules to the project for easy access

  • Set breakpoints in the modules as needed

  • Debug the query as you see fit

  • When starting a new debugging session make sure that the modules which you will debug are already opened in the editor. This is necessary so that the breakpoints in modules will be considered. Also make sure there are no other opened modules which are not involved in the current debugging session

Peculiarities and limitations of the MarkLogic debugger integration:

  • Debugging support is available only for MarkLogic server versions 3.2 or newer.

  • For MarkLogic server versions 4.0 or newer there are three XQuery syntaxes which are supported: '0.9-ml' (inherited from MarkLogic 3.2), '1.0-ml' and '1.0'

  • All the debugging steps are executed by the MarkLogic server and the results or possible errors of each step are presented by the local debugger user interface.

  • All declared variables are presented as strings.

  • No support for Output to Source Mapping.

  • No support for evaluating break conditions.

  • No support for showing the trace.

  • Breakpoints can be set in the imported modules but they are only active if the modules are opened in the editor at the time of debugging.

  • Break conditions are not supported hence the Break Conditions view is disabled in the XQuery Debugger perspective.

  • The modules can only be opened in the editor during the debugging session by stepping in repeatedly until reaching the module.

  • There should not be any breakpoints set in modules from the same server which are not involved in the current debugging session.

  • No support for profiling when an XQuery transformation is executed in the debugger.