using transactions for getAllEdges method