error:Transaction has already been committed or discarded

Hi @tss,

I see that you are using dgraph4j (Dgraph Client for Java) . Looking at the error, it seems that you are using AsyncTransaction .

The error is caused when a .commit or .doRequest is called on the same mutation more than once.

As the Mutation mu is constructed with setCommitNow(true) , there is no need to commit the transaction after .mutate has been executed.

I suspect that .commit or .doRequest is being executed after the last .mutate which is causing the error.

Can you confirm if that’s the case ?