agave-jobs/jobs-core/src/main/java/org/iplantc/service/jobs/dao/JobDao.java
/**
	 * Counts the number of active jobs in a tenant.
	 * @return number of currently active jobs.
	 * @throws JobException if the query cannot be performed.
	 */
Counts the number of active jobs in a tenant.
@return number of currently active jobs.
@throws JobException if the query cannot be performed.
Counts the number of active jobs in a tenant . @return number of currently active jobs . @throws JobException if the query cannot be performed .
public static Integer countTotalActiveJobs() throws JobException
	{
		try
		{
			Session session = getSession();
			session.clear();
			String hql = "select count(*) "
					+ "from Job j "
					+ "where j.status in (" + JobStatusType.getActiveStatusValues() + ") "
					+ "		and j.visible = :visible";
			int currentJobCount = ((Long)session.createQuery(hql)
					.setBoolean("visible", true)
					.uniqueResult()).intValue();
			session.flush();
			return currentJobCount;
		}
		catch (Throwable ex)
		{
			throw new JobException(ex);
		}
		finally {
			try { HibernateUtil.commitTransaction();} catch (Exception ignored) {}
		}
	}
public static Integer countTotalActiveJobs ( ) throws JobException { try { Session session = getSession ( ) ; session . clear ( ) ; String hql = "select count(*) " + "from Job j " + "where j.status in (" + JobStatusType . getActiveStatusValues ( ) + ") " + "		and j.visible = :visible" ; int currentJobCount = ( ( Long ) session . createQuery ( hql ) . setBoolean ( "visible" , true ) . uniqueResult ( ) ) . intValue ( ) ; session . flush ( ) ; return currentJobCount ; } catch ( Throwable ex ) { throw new JobException ( ex ) ; } finally { try { HibernateUtil . commitTransaction ( ) ; } catch ( Exception ignored ) { } } }
Counts the number of active jobs in a tenant.
Counts the number of active jobs in a tenant .