title: @Transactional annotation works with saveAndFlush?
body: <p>I have the following implementation. </p>
  
  <pre><code>@Transactional
  public void saveAndGenerateResult(Data data) {
      saveDataInTableA(data.someAmountForA);
      saveDataInTableB(data.someAmountForB);
      callAnAggregatedFunction(data);
  }
  
  public void saveDataInTableA(DataA a) {
      tableARepository.saveAndFlush(a);
  }
  
  public void saveDataInTableA(DataB b) {
      tableBRepository.saveAndFlush(b);
  }
  
  public void callAnAggregatedFunction() {
      // Do something based on the data saved from the beginning in Table A and Table B
  }
  </code></pre>
  
  <p>It is important to use <code>saveAndFlush</code> to have the data immediately available to the <code>callAnAggregatedFunction</code> function to get an aggregated result and save it to another table. That is why I am not using <code>save</code> function which does not flush the transactions into database immediately as far as I know. </p>
  
  <p>However, I am using a <code>@Transactional</code> annotation over the function <code>saveAndGenerateResult</code>, as I want to rollback the database transactions that I have done in that function in case of any failure which is normally ensured by having a <code>@Transactional</code> annotation over a method. </p>
  
  <p>What will be the scenario in this specific case? I am using <code>saveAndFlush</code> which flushes the data immediately into the database table and if the last function (i.e. <code>callAnAggregatedFunction</code>) fails to write the data into the table, will the previous write operations in table A and table B will be rollbacked? </p>