@Override public void setJobQueue(int idJob, int idQueue) { DbConn cnx = null; try { cnx = getDbSession(); QueryResult qr = cnx.runUpdate("jj_update_queue_by_id", idQueue, idJob); if (qr.nbUpdated != 1) { throw new JqmClientException("Job instance does not exist or has already started"); } cnx.commit(); } catch (DatabaseException e) { if (e.getCause() instanceof SQLIntegrityConstraintViolationException) throw new JqmClientException("Queue does not exist", e); else throw new JqmClientException("could not change the queue of a job (internal error)", e); } catch (Exception e) { throw new JqmClientException("could not change the queue of a job (internal error)", e); } finally { closeQuietly(cnx); } }