Replacing repoze.tm2 with a custom transaction manager to avoid generator consumption issue caused by repoze.tm2 version 2.0