The way you do an async transaction now is through `transaction(...)`, so what you suggest could be

The way you do an async transaction now is through
transaction(...)
, so what you suggest could be done by starting one in one fetch/rpc call, but without awaiting the returned promise and just storing it in-memory. Then another request can await for it when needed.
This should work, but again, consistency is up to you to make sure what you do inside the transaction call is OK.
For example, if you try to iterate a cursor across IO context boundaries, I think it won't work (well-defined).
Was this page helpful?