@Override
  public void callFailure(
      final SendableInsert insert, final LowLevelPutException e, int prio, boolean persistent) {
    if (!persistent) {
      insert.onFailure(e, null, null, clientContext);
    } else {
      try {
        jobRunner.queue(
            new DBJob() {

              @Override
              public boolean run(ObjectContainer container, ClientContext context) {
                if (container.ext().isActive(insert))
                  Logger.error(this, "ALREADY ACTIVE: " + insert + " in callFailure(insert)");
                container.activate(insert, 1);
                insert.onFailure(e, null, container, context);
                container.deactivate(insert, 1);
                return false;
              }

              @Override
              public String toString() {
                return "SendableInsert onFailure";
              }
            },
            prio,
            false);
      } catch (DatabaseDisabledException e1) {
        Logger.error(
            this,
            "callFailure() on a persistent request but database disabled",
            new Exception("error"));
      }
    }
  }
 public void cancel(ObjectContainer container, ClientContext context) {
   synchronized (this) {
     if (finished) return;
     finished = true;
   }
   boolean wasActive = true;
   if (persistent) {
     container.store(this);
     wasActive = container.ext().isActive(cb);
     if (!wasActive) container.activate(cb, 1);
     container.activate(sourceData, 1);
   }
   if (freeData) {
     sourceData.free();
     if (persistent) sourceData.removeFrom(container);
     sourceData = null;
     if (persistent) container.store(this);
   }
   super.unregister(container, context, getPriorityClass(container));
   cb.onFailure(new InsertException(InsertException.CANCELLED), this, container, context);
   if (!wasActive) container.deactivate(cb, 1);
 }
 @Override
 public void removeTransientInsertFetching(SendableInsert insert, Object token) {
   selector.removeTransientInsertFetching(insert, token);
   // Must remove here, because blocks selection and therefore creates cooldown cache entries.
   insert.clearCooldown(null, clientContext, false);
 }