Hi,
I’ve used dgo v1 for following procedure (basically trying to upsert data) and it works fine. When I upgrade to v2 (for dgraph 1.1.0 server) it gives me “Transaction has already been committed or discarded” error. Anyone knows what cause it? Thank you!
ctx := context.Background()
txn := this._dgraphClient.NewTxn()
defer txn.Discard(ctx)
…
txn.QueryWithVars(…)
…
txn.QueryWithVars(…)
…
…
…
_, err := txn.Mutate(
ctx,
&api.Mutation{
SetNquads: byte(Nquads.String()),
},
)
if nil != err {
return err … Error was thrown here
}