agave-jobs/jobs-core/src/main/java/org/iplantc/service/jobs/dao/JobPermissionDao.java
/**
	 * Saves a new job permission. Upates existing ones.
	 * @param pem
	 * @throws JobException
	 */
Saves a new job permission. Upates existing ones.
@param pem
@throws JobException
Saves a new job permission . Upates existing ones . @param pem @throws JobException
public static void persist(JobPermission pem) throws JobException
	{
		if (pem == null)
			throw new JobException("Permission cannot be null");
		try
		{
			Session session = getSession();
			session.saveOrUpdate(pem);
			session.flush();
		}
		catch (HibernateException ex)
		{
			try
			{
				if (HibernateUtil.getSession().isOpen()) {
					HibernateUtil.rollbackTransaction();
				}
			}
			catch (Exception e) {}
			throw new JobException("Failed to save job.", ex);
		}
		finally {
			try { HibernateUtil.commitTransaction(); } catch (Exception e) {}
		}
	}
public static void persist ( JobPermission pem ) throws JobException { if ( pem == null ) throw new JobException ( "Permission cannot be null" ) ; try { Session session = getSession ( ) ; session . saveOrUpdate ( pem ) ; session . flush ( ) ; } catch ( HibernateException ex ) { try { if ( HibernateUtil . getSession ( ) . isOpen ( ) ) { HibernateUtil . rollbackTransaction ( ) ; } } catch ( Exception e ) { } throw new JobException ( "Failed to save job." , ex ) ; } finally { try { HibernateUtil . commitTransaction ( ) ; } catch ( Exception e ) { } } }
Saves a new job permission.
Saves a new job permission .