title: java transaction management - propagation
body: <pre><code>@Transactional(propagation = Propagation.REQUIRES_NEW)
  public void jasperToInvoice1(BigDecimal generateNo) throws ClassNotFoundException, SQLException, JRException{
      List&lt;TInvoiceSummary&gt; invoices = invoiceSummaryRepository.findListSummary(generateNo) ;
      Connection connection =  dataSource.getConnection() ;
      if (invoices.size() &gt; 0) {
          int i = 1 ;
          for(TInvoiceSummary invoice : invoices) {
              jasperConvert.jInvoicePdf(invoice,connection);
              invoice.setIsPdf(true);
  
              em.merge(invoice) ;
              if(i % batchSize == 0) {
                  em.flush();
                  em.clear();
              }
              i++ ;
          }
      }
  }
  </code></pre>
  
  <p>I want to ask something about spring transactional propagation. Let's say I want to insert 10.000 rows into my DB. When I insert to DB I want to flush every 100 record. Is it possible to select the record while the process is still running? and how to do that?</p>
  
  <p>please let me know how to do that and if someone have an alternative way to do something like this.</p>
  
  <p>Thanks</p>