title: Multi-threaded use of SQLAlchemy
body: <p>I want to make a Database Application Programming Interface written in Python and using SQLAlchemy (or any other database connectors if it is told that using SQLAlchemy for this kind of task is not the good way to go). The setup is a MySQL server running on Linux or BSD and a the Python software running on a Linux or BSD machine (Either foreign or local).</p>
  
  <p>Basically what I want to do is spawn a new thread for each connections and the protocol would be custom and quite simple, although for each requests I would like to open a new transaction (or session as I have read) and then I need to commit the session. The problem I am facing right now is that there is high probability that another sessions happen at the same time from another connection.</p>
  
  <p>My question here is what should I do to handle this situation?</p>
  
  <ul>
  <li>Should I use a lock so only a single session can run at the same time?</li>
  <li>Are sessions actually thread-safe and I am wrong about thinking that they are not?</li>
  <li>Is there a better way to handle this situation?</li>
  <li>Is threading the way not-to-go?</li>
  </ul>