When updating or creating a new object in a Celery task, reading the new data in the main thread fails. After the update / create I issue
db.session.commit()
From cmd it seems that the data was updated in the DB, but maybe something with the session is still getting the old data. When I update some objects in the same thread it works ok.