Do you use @Version somewhere in your model?
The exception usually tells you that an update failed, because the row didn’t exist in the table with the expected version. This can be due to another transaction deleting the row or updating it and hence incrementing the version to a higher value.
Or maybe the row simply never existed in the database, but you try to persist/merge it with a fixed id, even though the model says that property is generated.