Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Disabled autocommit on select #116
def execute_sql(self, sql, params=None, require_commit=True): cursor = self.get_cursor() res = cursor.execute(sql, params or ()) if require_commit and self.get_autocommit(): self.commit() logger.debug((sql, params)) return cursor
A continously running application which only does selects opens a transaction once and keeps it open forever (tested with PostgreSQL).
Looks like a bug, isn't it?
This comment has been minimized.
This comment has been minimized.Show comment Hide comment
My thinking was that we should only explicitly commit when, first of all, it is warranted (by being a query that writes something) and second of all, that the commit isn't being managed elsewhere.
I am not aware of the need to open a transaction when doing SELECTs. That seems odd -- can you provide a little more info?