title: Only run method when previous method has commited
body: <p>I have a method which creates a database entry.
  After that a second method reads this database entry.</p>
  <pre><code>public IfdmJob startIfdmRun(Scenario scenario) throws IfdmConfException {
          scenario.valideerVoorIfdm();
          try {
              IfdmJob ifdmJob = createIfdmJob(scenario); // CREATES A JOB ENTRY IN THE DATABASE
              startJob(ifdmJob); // READS THE JOB ENTRY
              return ifdmJob;
          } catch (Exception e) {
              log.error(&quot;Failed to start ifdm run&quot;, e);
              throw new IfdmConfException(IfdmConfException.Message.GENERAL);
          }
      }
      
      private void startJob(IfdmJob ifdmJob) {
          ifdmWorkerService.startJob(ifdmJob);
      }
      
      private IfdmJob createIfdmJob(Scenario scenario) throws IOException, InvalidValueException {
          removeRunningIfdmJobs(scenario);
          IfdmRun ifdmRun = new IfdmRun(scenario);
          byte[] zipFile = createIfdmZipFile(ifdmRun);
          IfdmJob ifdmJob = new IfdmJob(scenario, zipFile, userService.getLoggedInUser().getUsername());
          return entiteitService.create(ifdmJob);
      }
  </code></pre>
  <p>The problem I am having is that the commit of the createIfdmJob method has not completed yet so the startJob goes to look for the entry but can't find it and cancels the job.</p>
  <p>Is their a way in which I can ensure the startjob method only starts when the commit of createIfdmJob has triggered?</p>