title: Sqlalchemy returns different results of the SELECT command (query.all)
body: <p>I have web server (512 RAM) with: 
  FLASK + SQLAlchemy (SQLite) -> uWSGI -> Nginx</p>
  
  <p>PROBLEM: Sqlalchemy returns different results of the SELECT command (query.all).</p>
  
  <p>Example:</p>
  
  <ul>
  <li>Added a few records in the database.</li>
  <li>I reload the page: new records have not returned (but old returned).</li>
  <li>Reload the page: all the records returned. Excellent.</li>
  <li>Reload the page: again new records have not returned. (But old returned).</li>
  </ul>
  
  <p>This happens as long as I do not restart Flask app.</p>
  
  <p>The code below:</p>
  
  <pre><code>DECLARATIVE_BASE = declarative_base()
  engine = create_engine('sqlite:///database.db')
  Session = sessionmaker(bind=engine)
  session = Session()
  
  class Order(DECLARATIVE_BASE):
      __tablename__ = 'orders'
      __table_args__ = (
          {'mysql_engine': 'InnoDB', 'sqlite_autoincrement': True, 'mysql_charset': 'utf8'}
      )
  
      id = Column(INTEGER, autoincrement=True, primary_key=True, nullable=False)  # pylint: disable=invalid-name
      name = Column(TEXT, nullable=False)
      address = Column(TEXT)
      phone = Column(TEXT, nullable=False)
      email = Column(TEXT)
      comment = Column(TEXT)
      totalPrice = Column(DECIMAL(asdecimal=False))
      orderItems = relationship(Orderitem)
      time = Column(TEXT, default=time.strftime("%H:%m %d.%m.%y"))
  
      def __repr__(self):
          return self.__str__()
  
      def __str__(self):
          return "&lt;Order(%s)&gt;" % self.__dict__
  
  @app.route('/api/orders', methods=['GET'])
  def getAllOrders():
      allOrders = session.query(Order).all()
      return json.dumps(allOrders, cls=new_alchemy_encoder(False, ['orderItems', 'product']), check_circular=False, ensure_ascii=False) #ensure_ascii=False -- for rigth out cyrlic;
  </code></pre>