logger.debug("upsert: {}", dbObject);
applicationStoreDAO.getCollection().update(query, dbObject, true, false, WriteConcern.SAFE);
applicationLogoDAO.deleteById(application.getApikey());
ApplicationLogo applicationLogo = new ApplicationLogo();
applicationLogo.setData(logo);
applicationLogo.setApikey(application.getApikey());
applicationLogo.setContentType("application/octet-stream");
applicationLogo.setFilename("logo.png");
applicationLogoDAO.save(applicationLogo);
applicationMap.put(application.getApikey(), application);
}