Eliminating contextmanager based transaction-handling

To close #8277
Maybe a bit nitpicking, but what you name here `trans` is actually a `connection` in sqlalchemy-terminology (see http://docs.sqlalchemy.org/en/rel_0_9/core/connections.html#using-transactions, second code block), so maybe we should follow that.