agave-tags/tags-core/src/main/java/org/iplantc/service/tags/dao/TagDao.java
/**
	 * Saves or updates the {@link Tag}
	 * @param tag the tag to save or update
	 * @throws TagException if unable to persist the tag
	 */
Saves or updates the  Tag
@param tag the tag to save or update
@throws TagException if unable to persist the tag
Saves or updates the Tag @param tag the tag to save or update @throws TagException if unable to persist the tag
public void persist(Tag tag) throws TagException
	{
		if (tag == null)
			throw new TagException("Tag cannot be null");
		try
		{	
			HibernateUtil.beginTransaction();
			Session session = HibernateUtil.getSession();
			session.clear();
			session.saveOrUpdate(tag);
			session.flush();
		}
		catch (HibernateException ex)
		{
			try
			{
				if (HibernateUtil.getSession().isOpen()) {
					HibernateUtil.rollbackTransaction();
				}
			}
			catch (Exception ignored) {}
			throw new TagException("Failed to save tag", ex);
		}
		finally {
			try { HibernateUtil.commitTransaction(); } catch (Exception ignored) {}
		}
	}
public void persist ( Tag tag ) throws TagException { if ( tag == null ) throw new TagException ( "Tag cannot be null" ) ; try { HibernateUtil . beginTransaction ( ) ; Session session = HibernateUtil . getSession ( ) ; session . clear ( ) ; session . saveOrUpdate ( tag ) ; session . flush ( ) ; } catch ( HibernateException ex ) { try { if ( HibernateUtil . getSession ( ) . isOpen ( ) ) { HibernateUtil . rollbackTransaction ( ) ; } } catch ( Exception ignored ) { } throw new TagException ( "Failed to save tag" , ex ) ; } finally { try { HibernateUtil . commitTransaction ( ) ; } catch ( Exception ignored ) { } } }
Saves or updates the {@link Tag}
 @param tag the tag to save or update
 @throws TagException if unable to persist the tag
Saves or updates the { @link Tag } @param tag the tag to save or update @throws TagException if unable to persist the tag