title: Autocommit in Flask-SQLAlchemy
body: <p>How do I set initilize my Flask application to set Flask-SQLAlchemy to autocommit mode, to not use transactions unless I explicitly <code>session.begin()</code>? </p>
  
  <p>The session "<a href="http://docs.sqlalchemy.org/en/rel_0_9/orm/session.html">begins a database transaction as soon as it starts communicating</a>". Does this affect Postgres <strong>harder</strong> than MySQL?</p>
  
  <hr>
  
  <p>By <a href="http://instagram-engineering.tumblr.com/post/40781627982/handling-growth-with-postgres-5-tips-from-instagram">Instagram</a>,</p>
  
  <blockquote>
    <p>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:</p>
    
    <p>connection.autocommit = True</p>
    
    <p>This lowered chatter between our application servers and DBs
    significantly, and lowered system CPU as well on the database boxes</p>
  </blockquote>