The transaction handling while upgrading the database schema had to be revised. Furthermore some QSqlQuery statements needed to be finished properly. Fixes issue 2556