for(FetchFailedMarker marker : getExpiredFetchFailedMarkers(now)) {
synchronized(Persistent.transactionLock(db)) {
try {
if(marker instanceof MessageFetchFailedMarker) {
MessageFetchFailedMarker m = (MessageFetchFailedMarker)marker;
MessageReference ref = m.getMessageReference();
ref.clearMessageWasDownloadedFlag();
ref.storeWithoutCommit();
} else if(marker instanceof MessageListFetchFailedMarker) {
MessageListFetchFailedMarker m = (MessageListFetchFailedMarker)marker;
try {
MessageList list = getMessageList(m.getMessageListID());
list.deleteWithoutCommit();