I’m noticing when running:
uid := FunctionToGetUidBasedOnValue(value)
if uid == "" {
CreateNode(value)
}
err := txn.Commit()
if err != nil {
txn.Discard()
}
I still get duplicate values made of the same value. I want nodes to be unique based on value.
I have used debug and found that multiple goroutines running FunctionToGetUidBasedOnValue(value) with the same value contents are saying that no object exists.
How is this possible?
I thought txn.Commit() forced the get query to happen at the same time as the Mutate, and if the get failed, it would fail the Mutate.