I don't think you need these intermediate `transaction.commit()` lines. The [final one](https://github.com/cbmi/varify/pull/223/files#diff-03420cb5c57d6d31358d6f4e801a2cecR52) should handle it.