Release savepoint if we could not upgrade db.
More fixes to transactions logic.
Increase buffer length for repo upgrade.
Avoid double free of database object.