title: Spring @Transactional concurrency
body: <p><pre><code>
  class MyService {</p>
  
  <p>public void a() {
       synchronized(somekey) {
          b(); 
       }
    }</p>
  
  <p>@Transactional(propagation = Propagation.REQUIRES_NEW)
    public void b() {
      ...do DB works...
    }
  }
  </pre></code></p>
  
  <p>My aim is</p>
  
  <ol> 1 - get the key </ol>
  
  <ol> 2 - start transaction</ol>
  
  <ol> 3 - commit transaction</ol>
  
  <ol> 4 - release the key</ol>
  
  <p>When i call a() method from outside, transaction doesn't work. </p>
  
  <p>Any suggestions ? </p>
  
  <p>Thanks.</p>