Execute an action inside a SQL transaction.
This function initiates a transaction with a "begin
transaction" statement, then executes the supplied action. If
the action succeeds, the transaction will be completed with
Base.commit before this function returns.
If the action throws any kind of exception (not just a PostgreSQL-related exception), the transaction will be rolled back using rollback, then the exception will be rethrown.
For nesting transactions, see withSavepoint.