agave-systems/systems-core/src/main/java/org/iplantc/service/transfer/dao/TransferTaskDao.java
/**
	 * Saves a {@link TransferTask} or updates if already saved.
	 * @param task
	 * @throws TransferException
	 */
Saves a  TransferTask or updates if already saved.
@param task
@throws TransferException
Saves a TransferTask or updates if already saved . @param task @throws TransferException
public static void persist(TransferTask task) throws TransferException
	{
		if (task == null)
			throw new TransferException("TransferTask cannot be null");
		try
		{
			Session session = getSession();
			task.setLastUpdated(new Date());
			session.saveOrUpdate(task);
			session.flush();
		}
		catch (ObjectNotFoundException ex)
		{
			throw ex;
		}
		catch (HibernateException ex)
		{
			try
			{
				if (HibernateUtil.getSession().isOpen()) {
					HibernateUtil.rollbackTransaction();
				}
			}
			catch (Exception ignored) {}
			throw new TransferException("Failed to save transfer task", ex);
		}
		finally {
			try { HibernateUtil.commitTransaction(); } catch (Exception ignored) {}
		}
	}
public static void persist ( TransferTask task ) throws TransferException { if ( task == null ) throw new TransferException ( "TransferTask cannot be null" ) ; try { Session session = getSession ( ) ; task . setLastUpdated ( new Date ( ) ) ; session . saveOrUpdate ( task ) ; session . flush ( ) ; } catch ( ObjectNotFoundException ex ) { throw ex ; } catch ( HibernateException ex ) { try { if ( HibernateUtil . getSession ( ) . isOpen ( ) ) { HibernateUtil . rollbackTransaction ( ) ; } } catch ( Exception ignored ) { } throw new TransferException ( "Failed to save transfer task" , ex ) ; } finally { try { HibernateUtil . commitTransaction ( ) ; } catch ( Exception ignored ) { } } }
Saves a {@link TransferTask} or updates if already saved.
Saves a { @link TransferTask } or updates if already saved .