public AppCatalogResource get(Object identifier) throws AppCatalogException {
   EntityManager em = null;
   try {
     em = AppCatalogJPAUtils.getEntityManager();
     em.getTransaction().begin();
     AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(GLOBUS_SUBMISSION);
     generator.setParameter(GlobusJobSubmissionConstants.SUBMISSION_ID, identifier);
     Query q = generator.selectQuery(em);
     GlobusJobSubmission globusJobSubmission = (GlobusJobSubmission) q.getSingleResult();
     GlobusJobSubmissionResource globusJobSubmissionResource =
         (GlobusJobSubmissionResource)
             AppCatalogJPAUtils.getResource(
                 AppCatalogResourceType.GLOBUS_SUBMISSION, globusJobSubmission);
     em.getTransaction().commit();
     em.close();
     return globusJobSubmissionResource;
   } 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();
       }
       em.close();
     }
   }
 }
 public boolean isExists(Object identifier) throws AppCatalogException {
   EntityManager em = null;
   try {
     em = AppCatalogJPAUtils.getEntityManager();
     GlobusJobSubmission globusJobSubmission = em.find(GlobusJobSubmission.class, identifier);
     em.close();
     return globusJobSubmission != 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();
       }
       em.close();
     }
   }
 }
 public void remove(Object identifier) throws AppCatalogException {
   EntityManager em = null;
   try {
     em = AppCatalogJPAUtils.getEntityManager();
     em.getTransaction().begin();
     AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(GLOBUS_SUBMISSION);
     generator.setParameter(GlobusJobSubmissionConstants.SUBMISSION_ID, identifier);
     Query q = generator.deleteQuery(em);
     q.executeUpdate();
     em.getTransaction().commit();
     em.close();
   } 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();
       }
       em.close();
     }
   }
 }