// + " ID: " + job.getID() +
// " stops sleeping");
// System.out.println("-------------");
JobStatus st = null;
try {
nativeAdapter.updateJobStat(job);
// System.out.println("Job "+job.getID()+":\n" +
// job.getStat().toString());
st = getNextStatus(job.getStat());
} catch(NativeSGECommException ncce){
} catch(NativeSGEException ncrmae) {
st = JobStatus.COMPLETED;
terminate();
}
Transaction txn = null;
try {
txn = createTransaction(5 * 1000);
JobControlEntry jce =
(JobControlEntry)space.readIfExists(jControl, null,
JavaSpace.NO_WAIT);
if((st == null) || (jce == null)) {
continue;
}
if(!st.equals(jce.jobStatus)) {
jce = (JobControlEntry)
space.takeIfExists(jControl, txn, JavaSpace.NO_WAIT);
if(jce == null) {
if(txn != null)
txn.abort();