Hi Michael,
So when this XQuery is executed the second time:
let $parent := db:open('DB_Name')/path/to/parent/node return insert node <childNode><subNode>Example 1</subNode><subNode>Example 2</subNode></childNode> into $parent
... the error is thrown.
In order to understand what might go wrong, I would once again be thankful if you could provide us with reproducible steps, or a self-contained example.
I tried to simulate the repeated insertion in Java, but the attached Java code does not raise any errors. In the error message you attached,
org.basex.core.BaseXException: Stopped at ., 1/5847730: [XPDY0002] TM: no context value bound.
the query parser indicates that you want to address a TM step in your query – which does not exist if no database is opened, or if no item is bound to the current context. This is why I asked for the query that triggered the error (it’s difficult to judge what goes wrong without having more insight). If your query contains confidential information, you could open it in the BaseX GUI and jump to the referenced error position (line 1, column 5847730).
Cheers Christian