title: Is it thread-safe to use SQLAlchemy with engine/connections instead of sessions?
body: <p>I've got a simple webservice which uses SQLAlchemy to connect to a database using the pattern</p>
  
  <pre><code>engine = create_engine(database_uri)
  connection = engine.connect()
  </code></pre>
  
  <p>In each endpoint of the service, I then use the same connection, in the following fashion:</p>
  
  <pre><code>for result in connection.execute(query):
      &lt;do something fancy&gt;
  </code></pre>
  
  <p>Since <code>Session</code>s are not thread-safe, I'm afraid that <code>connection</code>s aren't either.</p>
  
  <p>Can I safely keep doing this? If not, what's the easiest way to fix it?</p>
  
  <p>Minor note -- I don't know if the service will ever run multithreaded, but I'd rather be sure that I don't get into trouble when it does.</p>