title: How to make multiple call of @Transactional method to a single transaction
body: <p>I have a method</p>
  
  <pre><code>@Transactional
  public void updateSharedStateByCommunity(List[]idList)
  </code></pre>
  
  <p>This method is called from the following REST API:</p>
  
  <pre><code>@RequestMapping(method = RequestMethod.POST)
  public ret_type updateUser(param) {
    // call updateSharedStateByCommunity
  }
  </code></pre>
  
  <p>Now the ID lists are very large, like 200000, When I try to process it, then it takes lots of time and on client side timeout error occurred.</p>
  
  <p>So, I want to split it to two calls with list size of 100000 each.</p>
  
  <p>But, the problem is, it is considered as 2 independent transactions.</p>
  
  <p>NB: The 2 calls is an example, it can be divided to many times, if number ids are more larger.</p>
  
  <p>I need to ensure two separate call to a single transaction. If any one of the 2 calls fails, then it should rollback to all operation.</p>
  
  <p>Also, in the client side, we need to show progress dialog, so I can't use only timeout.</p>