Eliminating contextmanager based transaction-handling

To close #8277