1

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?

Mike Gardner
  • 6,611
  • 5
  • 24
  • 34
  • 2
    There's no way to downgrade. Your only option would be to stand up a fresh ML9.x cluster and migrate your documents using something like MLCP. But it seems likely that a future update to ML9 could result in the same error, so probably a better option would be to contact support to help you resolve that error. – wst Jan 24 '20 at 16:48
  • Rather than attempt to downgrade, focus on fixing the issue. It would be easier to help diagnose and suggest changes if you shared the code for that `xdmp:invoke-function()` call. – Mads Hansen Jan 25 '20 at 04:38
  • I concur with Mads, moving forward is better. Just as general advice, always do a backup before upgrade, so that you can just restore that backup in a fresh ML9 cluster in case you need to go back.. – grtjn Jan 30 '20 at 09:28

1 Answers1

3

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.

Community
  • 1
  • 1
Mads Hansen
  • 63,927
  • 12
  • 112
  • 147