Search code examples
marklogicmarklogic-9downgrademarklogic-10

MarkLogic upgrade incompatibility (downgrade)


I recently upgraded our MarkLogic 9.x.x to 10.x.x (latest version). We encountered this error:

XDMP-NESTEDMULTI: xdmp:invoke-function(function() as item()*, query...) -- Cannot create a nested multi-statement transaction inside a multi-statement transaction.

Now our way to resolve this is to downgrade back to 9.x.x our version before the error showed up.

Is there a correct way to downgrade MarkLogic? or even resolve the error above?


Solution

  • You will need to inspect the code that is causing this error. Look for any eval, invoke, or spawn functions, and see what options have set the transaction-mode to update.

    transaction-mode

    [DEPRECATED: Use the update and commit options instead.] Explicitly set the transaction mode for this context. Allowed values: auto (default), query, update-auto-commit, update. For details, see Transaction Mode in the Application Developer's Guide.

    For simple updates to be implicitly committed, specify a transaction mode of update-auto-commit. A transaction mode of update creates a new multi-statement update transaction and requires an explicit commit in the code.

    Within a session there can be only one active multi-statement transaction at a time. If a new multi-statement transaction is specified nested inside a multi-statement transaction, MarkLogic throws the exception XDMP-NESTEDMULTI.

    https://docs.marklogic.com/8.0/messages/XDMP-en/XDMP-NESTEDMULTI

    Cause

    An eval or invoke with transaction-mode update was attempted in a multi-statement transaction.

    Response

    Use transaction-mode update-auto-commit instead.