title: Flask SQL Alchemy not updating database query inside route
body: <p>I have a route that reads from a database and then compares the value that is passed in to the route to the latest value in the database</p>
  
  <pre><code>@application.route("/complete", methods=['POST'])
  def complete():
      currentRound = request.json.get('round')
      block = db.session.query(Block).order_by(Block.id.desc()).first()
      if block.roundId == currentRound:
          return jsonify( { "round": "valid" } )
      else:
          return jsonify( { "round": "false" } )
  </code></pre>
  
  <p>But the block value never changes when new rows are added to the block table. For example when I first run the app, if the roundId for the last block added to the table is "123", the block.roundId in the above route will be "123". But if the app is still running and the database is updated so the newest row has an id of "456", the route will still say the block.roundId is "123".</p>
  
  <p>I've double checked and used the same query after a new row is added to the database and it returns the proper value, so I think the issue is something inside of the route. Any help is greatly appreciated.</p>