agave-common/common-core/src/main/java/org/iplantc/service/common/dao/DiscoveryServiceDao.java
/**
	 * Save or update a discoverableService
	 * 
	 * @param discoverableService
	 * @throws ServiceDiscoveryException 
	 */
Save or update a discoverableService

@param discoverableService
@throws ServiceDiscoveryException
Save or update a discoverableService @param discoverableService @throws ServiceDiscoveryException
public <T extends DiscoverableService> void persist(T discoverableService) throws ServiceDiscoveryException
	{
		if (discoverableService == null)
			throw new ServiceDiscoveryException("DatabaseDiscoverableService cannot be null");
		try
		{
			Session session = getSession();
			session.saveOrUpdate(discoverableService);
			session.flush();
		}
		catch (HibernateException ex)
		{
			try
			{
				if (HibernateUtil.getSession().isOpen())
				{
					HibernateUtil.rollbackTransaction();
					HibernateUtil.getSession().close();
				}
			}
			catch (Exception e)
			{
			}
			throw new ServiceDiscoveryException(ex);
		}
		finally {
			try { HibernateUtil.commitTransaction();} catch (Exception e) {}
		}
	}
public < T extends DiscoverableService > void persist ( T discoverableService ) throws ServiceDiscoveryException { if ( discoverableService == null ) throw new ServiceDiscoveryException ( "DatabaseDiscoverableService cannot be null" ) ; try { Session session = getSession ( ) ; session . saveOrUpdate ( discoverableService ) ; session . flush ( ) ; } catch ( HibernateException ex ) { try { if ( HibernateUtil . getSession ( ) . isOpen ( ) ) { HibernateUtil . rollbackTransaction ( ) ; HibernateUtil . getSession ( ) . close ( ) ; } } catch ( Exception e ) { } throw new ServiceDiscoveryException ( ex ) ; } finally { try { HibernateUtil . commitTransaction ( ) ; } catch ( Exception e ) { } } }
Save or update a discoverableService
Save or update a discoverableService