title: Synchronized Transactional method in Spring
body: <p>We have following method in our code which has <code>Transactional</code> annotation and is synchronized.</p>
  
  <pre><code>@Transactional(propagation=Propagation.REQUIRED, rollbackFor=Exception.class)
  public synchronized void addValueToDB(String value, int parent) {
    int nextId = getNextIDUsingSequence();
    insertIntoDB(nextId, value);
    updateLeft(parent);
    updateRight(parent);
  }
  </code></pre>
  
  <p>Now as <code>Transactional</code> annotation commits in database after method completion so <strong>synchronization</strong> on this method seems useless to me? Does spring provides any solution to this or should I synchronize the block from where this method is getting called?</p>