[Persistence] Requeue on overwrite

Requeue (instead of trying to access persistence again) on overwrite
WTD-1033.
This commit is contained in:
Victor Woeltjen
2015-03-24 14:09:51 -07:00
parent 2709fde9a3
commit 6b43256afd
3 changed files with 32 additions and 23 deletions

View File

@ -16,14 +16,11 @@ define(
// Issue a new persist call for the domain object associated with
// this failure.
function persist(failure) {
var decoratedPersistence =
failure.domainObject.getCapability('persistence');
// Note that we issue the persist request here, but don't
// return it. We trust that the PersistenceQueue will
// behave correctly on the next round of flushing.
if (decoratedPersistence) {
decoratedPersistence.persist();
}
// Note that we reissue the persist request here, but don't
// return it, to avoid a circular wait. We trust that the
// PersistenceQueue will behave correctly on the next round
// of flushing.
failure.requeue();
}
// Retry persistence (overwrite) for this set of failed attempts