When I run a Flask application which is using Flask-SQLAlchemy, it seems that Flask-SQLAlchemy is holding a session and when I issue a MySQL command, like alter table add column, in MySQL client terminal, the commands cannot be executed until I quit the Flask application.
Does anybody have similar experience? How can I issue commands on MySQL client without interrupting the Flask application?
You may want to look at this question SQL Alchemy Relationship loader leaves a lock on table?
What you’ll need to do is subclass
flask.ext.sqlalchemy.SQLAlchemyand override theapply_driver_hacksmethod to pass through the additional keyword argumentisolation_level='READ <some level>':