Commit/rollback transaction after rendering response to prevent TransactionManagementErrors due to db access in templates.