private void checkAssignedJobs() {
        long dif;
        ServerSideJob j;
        JobRecord jr;
        final Collection<JobRecord> remove = new LinkedList<JobRecord>();
        synchronized (activeJobs) {
            Iterator<JobRecord> it = activeJobs.iterator();
            while (it.hasNext()) {
                jr = it.next();
                j = jr.getJob();
                if (j.getStatus().equals(JobStatus.SENT)) {
                    dif = Calendar.getInstance().getTimeInMillis() - jr.getLastAction().getTimeInMillis();
                    if (dif > Timeout.getTimeout(Timeout.TimeoutType.JOB_CHECK)) {
                        try {
                            j.cancelJob();
                            j.setStatus(JobStatus.SUBMITTED);
                        } catch (ConnectionException ex) {
                            LOG.log(Level.WARNING, "Could not contact client with ID {0} for job cancelation.", jr.getOwner().getTargetId());
                        }
                        storeJobAction(j, jr.getOwner().getTargetId(), JobConstants.JOB_CANCEL);
                        LOG.log(Level.INFO, "Job with id {0} hasnt been accepted in time, so it was cancelled and returned to queue.", j.getId());
                        if (!jobQueue.contains(j)) {
                            jobQueue.addFirst(j);
                        }
                        remove.add(jr);
                    }
                }
            }
            activeJobs.removeAll(remove);
        }
    }