HashMap<String, String> ids;
if (identifier instanceof Map){
ids = (HashMap)identifier;
}else {
logger.error("Identifier should be a map with the field name and it's value");
throw new AppCatalogException("Identifier should be a map with the field name and it's value");
}
EntityManager em = null;
try {
em = AppCatalogJPAUtils.getEntityManager();
GSISSHPreJobCommand gsisshPreJobCommand = em.find(GSISSHPreJobCommand.class, new GSISSHPreJobCommandPK(
ids.get(GSISSHPreJobCommandConstants.SUBMISSION_ID),
ids.get(GSISSHPreJobCommandConstants.COMMAND)));
em.close();
return gsisshPreJobCommand != null;
} catch (ApplicationSettingsException e) {
logger.error(e.getMessage(), e);
throw new AppCatalogException(e);
} finally {
if (em != null && em.isOpen()) {
if (em.getTransaction().isActive()) {
em.getTransaction().rollback();
}