code: private void firstBlockDbFailureAnalysis(Exception e)
      {
          if (Helpers.testDbFailure(e))
          {
              jqmlogger.error("connection to database lost - loader " + this.ji.getId() + " will be restarted later");
              jqmlogger.trace("connection error was:", e);
              this.engine.loaderRestartNeeded(this);
              if (this.engine.getHandler() != null)
              {
                  this.engine.getHandler().onJobInstanceDone(this.ji);
              }
              return;
          }
          else
          {
              jqmlogger.error("a database related operation has failed and cannot be recovered", e);
              resultStatus = State.CRASHED;
              endOfRun();
              return;
          }
      }
docs: /////////////////////////////////////////////////////////////////////////