title: @Transactional saveAll not working for a table in 2nd data source Spring JPA
body: <p>I have 2 data sources, ds1, ds2. In a single service which is @Transactional I have to get the values from two tables and update them.</p>
  
  <p>Sample snippet</p>
  
  <pre><code>    @Service
      public class MyService {
      @Autowired
      ds1Repository ds1Repository; // from data source 1 (DB Name - DB1) MYSQL
      @Autowired
      ds2Repository ds2Repository; // from data source 2 (DB Name - DB2) MYSQL
  
      @Transactional (javax.Transactional)
      public void processUpdates() {
          // Able to get the result set from both the data sources
          List&lt;Data1&gt; ds1Data = ds1Repository.findAll();
          List&lt;Data2&gt; ds2Data = ds1Repository.findAll();
  
          // modified the collections ds1Data &amp; ds2Data
  
          // This is getting updated
          ds1Repository.saveAll(ds1Data);
  
          // This update is not heppening and no exception thrown
          ds2Repository.saveAll(ds2Data);
      }
  }
  </code></pre>
  
  <p>I have tried the following wys:</p>
  
  <ol>
  <li>I have configired both the data sources which are working fine, able to read the data from boths databases</li>
  <li>After searching, tried ChainedTransactionManager, by defining custom transaction manager names for both data sources and used @Transactional(value="chainedTransactionManager") on top of service. Still did not work.</li>
  </ol>
  
  <p>Can anyone help me what was wring with the code ? why the data only on data source 2 is not getting persisted?</p>