-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disabled autocommit on select #116
Comments
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? |
autocommit mode, will open a transaction for any query, including selects. If not comitted, leads to idle in transactions -- this fixes and also addresses #116
Thanks for reporting -- i didn't realize that psycopg2, as you said, opens a transaction every query. This should be fixed now, and select queries will have their transactions handled correctly |
Great, thanks for the quick fix! |
The
Database.execute_sql()
considers 2 parameters when deciding if to do a commit after executing a statement:Two issues:
SelectQuery
has setrequire_commit = False
?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?
The text was updated successfully, but these errors were encountered: