We are trying to see if it’s possible to create a new transaction using the grpc js library, and then extract some identifier in order to pass it around multiple distinct services/modules in order to have a single atomic multi-service DQL transaction.
We’re hoping that with something like that we can avoid the mess of having to consistently keep track of which services were involved in the (essentially meta-) transaction and rolling them all back individually when it fails, and rather just have everything under one umbrella.
So far, we’ve had a look at TxnContext and Txn, and we think it might be possible to generate a new TxnContext at runtime by hand, then set the ctx field inside Txn to the new TxnContext (while vehemently telling typescript to ignore the private setting on the field), but for lack of better documentation, we don’t know whether that will actually work like we want it to, or whether there is a “cleaner”/“more correct” way to do it.
Dgraph version : v21.03.1
Dgraph codename : rocket-1
Dgraph SHA-256 : a00b73d583a720aa787171e43b4cb4dbbf75b38e522f66c9943ab2f0263007fe
Commit SHA-1 : ea1cb5f35
Commit timestamp : 2021-06-17 20:38:11 +0530
Branch : HEAD
Go version : go1.16.2
jemalloc enabled : true