ec = newEditingContext();
ec.lock();
try {
TaskInfo taskInfo = (TaskInfo) ec.faultForGlobalID(_taskInfoGID, ec);
taskInfo.setStartTime(new NSTimestamp(startTime));
taskInfo.setDuration(Long.valueOf(taskInfo.endTime().getTime() - startTime));
ec.saveChanges();
} finally {
ec.unlock();
}
}