Fixed deployDb - in setRAWformatForRBDVolumes use executeUpdate instead of executeQuery when perform an update with the prepared statement

This commit is contained in:
Alena Prokharchyk 2013-08-13 13:56:29 -07:00
parent 8f34dc192f
commit b2d2f2c050
1 changed files with 2 additions and 2 deletions

View File

@ -2538,9 +2538,9 @@ public class Upgrade410to420 implements DbUpgrade {
try {
s_logger.debug("Setting format to RAW for all volumes on RBD primary storage pools");
pstmt = conn.prepareStatement("UPDATE volumes SET format = 'RAW' WHERE pool_id IN(SELECT id FROM storage_pool WHERE pool_type = 'RBD')");
pstmt.executeQuery();
pstmt.executeUpdate();
} catch (SQLException e) {
throw new CloudRuntimeException("Failed to update volume format to RAW for volumes on RBD pools");
throw new CloudRuntimeException("Failed to update volume format to RAW for volumes on RBD pools due to exception ", e);
}
}
}