agave-tags/tags-core/src/main/java/org/iplantc/service/tags/dao/TagDao.java
/**
	 * Merges the active {@link Tag} back with the saved instance. Associations are
	 * not updated.
	 * TODO: this should not be needed. We can refresh instead.
	 *
	 * @param tag the tag to merge
	 * @return the updated tag.
	 * @throws TagException if unable to merge the tag object
	 */
Merges the active  Tag back with the saved instance. Associations are
not updated.
TODO: this should not be needed. We can refresh instead.

@param tag the tag to merge
@return the updated tag.
@throws TagException if unable to merge the tag object
Merges the active Tag back with the saved instance . Associations are not updated . TODO : this should not be needed . We can refresh instead . @param tag the tag to merge @return the updated tag . @throws TagException if unable to merge the tag object
public Tag merge(Tag tag) throws TagException
	{
		try
		{
			HibernateUtil.beginTransaction();
			Session session = HibernateUtil.getSession();
			session.clear();
			Tag mergedTag = (Tag)session.merge(tag);
			return mergedTag;
		}
		catch (HibernateException ex)
		{
			try
			{
				if (HibernateUtil.getSession().isOpen()) {
					HibernateUtil.rollbackTransaction();
				}
			}
			catch (Exception ignored) {}
			throw new TagException("Failed to merge tag", ex);
		}
		finally
		{
			try { HibernateUtil.commitTransaction(); } catch (Throwable ignored) {}
		}
	}
public Tag merge ( Tag tag ) throws TagException { try { HibernateUtil . beginTransaction ( ) ; Session session = HibernateUtil . getSession ( ) ; session . clear ( ) ; Tag mergedTag = ( Tag ) session . merge ( tag ) ; return mergedTag ; } catch ( HibernateException ex ) { try { if ( HibernateUtil . getSession ( ) . isOpen ( ) ) { HibernateUtil . rollbackTransaction ( ) ; } } catch ( Exception ignored ) { } throw new TagException ( "Failed to merge tag" , ex ) ; } finally { try { HibernateUtil . commitTransaction ( ) ; } catch ( Throwable ignored ) { } } }
Merges the active {@link Tag} back with the saved instance.
Merges the active { @link Tag } back with the saved instance .
//session.flush();