pending = true;
}
try{ wait(); } catch (InterruptedException e) {};
if(schedulingList.remove(context)){
// Logger.info("(Schedule 1) Remotely aborting: " + context);
throw new TransactionException();
}
}
//if(!context.status.equals(STATUS.ABORTED))
readers.add(context);
//else throw new TransactionException();
break;
case WRITE_MODE:
// Get exclusive access.
while (writer!=null || !readers.isEmpty() || ! writeValid) {
if(writeValid){
if(writer!=null){
Logger.debug("Client Side: Write Mode resolve");
int res = HyFlow.getConflictManager().resolve(context, writer);
if(res==0)
writer = null;
}
if(!readers.isEmpty()){
int res = HyFlow.getConflictManager().resolve(context, readers);
if(res==0) readers.clear();
}
continue;
}
// Ask for object if absent.
if (! writeValid && ! pending) {
RetrieveRequest retrieve = new RetrieveRequest(context, key, mode);
if (DEBUG)
Aleph.debug(this + " sends " + retrieve + " to " + key.getHome());
pendingContext = context;
retrieve.send(key.getHome());
pending = true;
}
try{ wait(); } catch (InterruptedException e) {};
//Logger.info("open abortedPending "+abortedPending.size());
if(schedulingList.remove(context)){
// Logger.info("(Schedule 2) Remotely aborting: " + context);
throw new TransactionException();
}
}
if(!context.status.equals(STATUS.ABORTED))
writer = context;
//else throw new TransactionException();