hostEntity.getHostComponentStateEntities().add(hostComponentStateEntity);
hostEntity.getHostComponentDesiredStateEntities().add(hostComponentDesiredStateEntity);
clusterServiceEntity.getServiceComponentDesiredStateEntities().add(componentDesiredStateEntity);
ClusterServiceDAO clusterServiceDAO = injector.getInstance(ClusterServiceDAO.class);
clusterServiceDAO.merge(clusterServiceEntity);
}
protected void executeInTransaction(Runnable func) {
EntityManager entityManager = injector.getProvider(EntityManager.class).get();
if (entityManager.getTransaction().isActive()) { //already started, reuse