There are times when we get the OakStateException because of conflicts between sessions and the best way to debug is to enable the logs with the below classes:
TRACE logs for "org.apache.jackrabbit.oak.jcr.operations.writes"
DEBUG logs for "org.apache.jackrabbit.oak.plugins.commit.MergingNodeStateDiff"
DEBUG logs for "org.apache.jackrabbit.oak.plugins.commit.ConflictValidator"