Closed happy-river closed 4 years ago
I added another commit to remove the recommendation to set autocommit
for Postgres, because I found the following deprecation warning in the peewee source code:
DeprecationWarning: Peewee no longer uses the "autocommit" option, as the semantics now require it to always be True. Because some database-drivers also use the "autocommit" parameter, you are receiving a warning so you may update your code and remove the parameter, as in the future, specifying autocommit could impact the behavior of the database driver you are using.
Just found out that we use autorollback in prod too. Dunno why I never added it to the config before
We noticed that sometimes errors arising from database transactions were killing other database transactions with the error message "DatabaseError: current transaction is aborted, commands ignored until end of transaction block". This happens because Postgres wants you to roll back queries with serious errors before doing anything else. Peewee can do this automatically if
autorollback
is set in the database config.