agave-systems/systems-core/src/main/java/org/iplantc/service/systems/dao/SystemDao.java
/**
     * Performs an atomic update of the {@link RemoteSystem} status and
     * {@link RemoteSystem#getLastUpdated()} timestamp.
     *
     * @param system
     * @param newStatus
     */
Performs an atomic update of the  RemoteSystem status and
RemoteSystem#getLastUpdated() timestamp.

@param system
@param newStatus
Performs an atomic update of the RemoteSystem status and RemoteSystem#getLastUpdated () timestamp . @param system @param newStatus
public void updateStatus(RemoteSystem system, SystemStatusType newStatus) {
        try {
            Session session = getSession();
            String sql = "update systems set `status` = :newstatus, `last_updated` = :rightnow where uuid = :uuid";
            session.createSQLQuery(sql)
                    .setString("newstatus", newStatus.name())
                    .setDate("rightnow", new Date())
                    .setString("uuid", system.getUuid())
                    .executeUpdate();
            session.flush();
        } catch (HibernateException ex) {
            try {
                if (HibernateUtil.getSession().isOpen()) {
                    HibernateUtil.rollbackTransaction();
                }
            } catch (Exception ignored) {
            }
            throw ex;
        } finally {
            try {
                HibernateUtil.commitTransaction();
            } catch (Throwable ignored) {
            }
        }
    }
public void updateStatus ( RemoteSystem system , SystemStatusType newStatus ) { try { Session session = getSession ( ) ; String sql = "update systems set `status` = :newstatus, `last_updated` = :rightnow where uuid = :uuid" ; session . createSQLQuery ( sql ) . setString ( "newstatus" , newStatus . name ( ) ) . setDate ( "rightnow" , new Date ( ) ) . setString ( "uuid" , system . getUuid ( ) ) . executeUpdate ( ) ; session . flush ( ) ; } catch ( HibernateException ex ) { try { if ( HibernateUtil . getSession ( ) . isOpen ( ) ) { HibernateUtil . rollbackTransaction ( ) ; } } catch ( Exception ignored ) { } throw ex ; } finally { try { HibernateUtil . commitTransaction ( ) ; } catch ( Throwable ignored ) { } } }
Performs an atomic update of the {@link RemoteSystem} status and
 {@link RemoteSystem#getLastUpdated()} timestamp.
Performs an atomic update of the { @link RemoteSystem } status and { @link RemoteSystem#getLastUpdated () } timestamp .