How do I set initilize my Flask application to set Flask-SQLAlchemy to autocommit mode, to not use transactions unless I explicitly session.begin()?
The session "begins a database transaction as soon as it starts communicating". Does this affect Postgres harder than MySQL?
By Instagram,
autocommit mode; in this mode, Psycopg2 won’t issue BEGIN/COMMIT for any queries; instead, every query runs in its own single-statement transaction. This is particularly useful for read-only queries where transaction semantics aren’t needed. It’s as easy as doing:
connection.autocommit = True
This lowered chatter between our application servers and DBs significantly, and lowered system CPU as well on the database boxes