title: Best way to impletent Java multithreading to prevent transaction rollback
body: <p>I have an List which contains say 4 DTOs. I am performing some processes on each of the DTOs present in my list. If suppose for one the DTO, any exception comes then all the transactions are rolled back (even if the process is success for other 3 DTOs).</p>
  <p>My code looks like this :</p>
  <pre><code>@Transactional
  public void processEvent(List&lt;MyObject&gt; myList){
     myList.forEach(dto -&gt; process(dto));
  }
  
  public void process(MyObject dto){
  //some code which calls another class marked as @Transactional
  // and save the data processed to database
  }
  
  </code></pre>
  <p>I want to perform these processes for each DTO on a sepearte thread such that exception encountered in one thread does not rollbacks transaction for all the DTOs.
  Also is there a way to process these DTOs one by one on different threads so that data consistency is maintained ?</p>