CLOUDSTACK-2664: Fixed delete query. Added log message when CloudRuntimeException is thrown during upgrade

This commit is contained in:
Kishan Kavala 2013-05-24 12:37:09 +05:30
parent 3e02a76f00
commit 3b48299a03
2 changed files with 5 additions and 2 deletions

View File

@ -261,7 +261,10 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker {
}
txn.commit();
} finally {
} catch (CloudRuntimeException e){
s_logger.error("Unable to upgrade the database", e);
throw new CloudRuntimeException("Unable to upgrade the database", e);
}finally {
txn.close();
}
}

View File

@ -759,7 +759,7 @@ public class Upgrade410to420 implements DbUpgrade {
while (rs.next()) {
long id = rs.getLong(1);
// remove Firewall service for SG shared network offering
pstmt = conn.prepareStatement("DELETE `cloud`.`ntwk_offering_service_map` where network_offering_id=? and service='Firewall'");
pstmt = conn.prepareStatement("DELETE from `cloud`.`ntwk_offering_service_map` where network_offering_id=? and service='Firewall'");
pstmt.setLong(1, id);
pstmt.executeUpdate();
}