Isolated¶
Runs a callback in a new, independent database transaction.
myScript.Isolated(fn: () => T):T
Parameters¶
() => T fn
The synchronous callback to execute.
Returns¶
The value returned by fn.
Remarks¶
Server workflow scripts only. The new transaction uses read-committed isolation and commits when the callback completes successfully. It is independent of the ambient transaction: a later rollback of the outer transaction does not undo this work. If this callback throws, its own transaction is rolled back; the error then propagates to the caller.
Example¶
1 2 3 4 5 6 | |