title: Commit message before sending in JMS queue
body: <p>I have JMS queue implementation in my project in which I am sending 100's of messages in one transaction but performing some DB operations before putting it in queue. i.e</p>
  
  <pre><code>//SuedoCode
  
  @Transactional(propagation = Propagation.REQUIRES_NEW)
  public void sendMsg(List orders )
  {
     for(Order order : orders)
    {
      order.setStatus("SENT");
      sendToQueue(order);
     }
  
  }
  </code></pre>
  
  <p>But this transaction is still not committed and receiver picks up the orders before sender's transaction is committed. Now receiver process the messages and change the status again then commits but after that senders transaction commits and it overrides the status which should not happen.</p>
  
  <p>Thus to solve this problem I created a new class (For spring proxy) which has method to change the status of order and this method is in <strong>REQUIRES_NEW</strong> transaction so the status has changed but If any error occur while sending the message to queue then again status needs to changed (because the previous transaction has already committed).
    Please suggest me If this approach is correct or something better can be done. 
  Thanks in advance</p>