diff --git a/openlp/core/lib/db.py b/openlp/core/lib/db.py index 0627259eb..7fcf0a808 100644 --- a/openlp/core/lib/db.py +++ b/openlp/core/lib/db.py @@ -191,10 +191,10 @@ def upgrade_db(url, upgrade): break except (SQLAlchemyError, DBAPIError): version_meta = Metadata.populate(key='version', value=int(upgrade.__version__)) - session.commit() + session.remove() upgrade_version = upgrade.__version__ version = int(version_meta.value) - session.close() + session.remove() return version, upgrade_version