title: How to avoid caching in sqlalchemy?
body: <p>I have a problem with SQL Alchemy - my app works as a constantly working python application.</p>
  
  <p>I have function like this:</p>
  
  <pre><code>def myFunction(self, param1):
     s = select([statsModel.c.STA_ID, statsModel.c.STA_DATE)])\
                          .select_from(statsModel)
  
     statsResult = self.connection.execute(s).fetchall()
  
     return {'result': statsResult, 'calculation': param1}
  </code></pre>
  
  <p>I think this is clear example - one result set is fetched from database, second is just passed as argument.</p>
  
  <p>The problem is that when I change data in my database, this function still returns data like nothing was changed. When I change data in input parameter, returned parameter "calculation" has proper value. </p>
  
  <p>When I restart the app server, situation comes back to normal - new data are fetched from MySQL.</p>
  
  <p>I know that there were several questions about SQLAlchemy caching like:</p>
  
  <p><a href="https://stackoverflow.com/questions/4285474/how-to-disable-caching-correctly-in-sqlalchemy-orm-session">How to disable caching correctly in Sqlalchemy orm session?</a></p>
  
  <p><a href="https://stackoverflow.com/questions/10210080/how-to-disable-sqlalchemy-caching">How to disable SQLAlchemy caching?</a></p>
  
  <p>but how other can I call this situation? It seems SQLAlchemy keeps the data fetched before and does not perform new queries until application restart. How can I avoid such behavior?</p>