title: Spring boot: ReentrantLock
body: <p>I've coded a <code>@Repository</code> class:</p>
  
  <pre><code>@Repository
  public class RepositoryDocumentDao {
  
      private static final Logger LOG = LoggerFactory.getLogger(RepositoryDocumentDao.class);
      private ReentrantLock lock;
  
      @Autowired
      public RepositoryDocumentDao(
      ) {
          this.lock = new ReentrantLock();
      }
  }
  </code></pre>
  
  <p>My related code is:</p>
  
  <pre><code>private boolean verifyStorageSize(long requiredBytes) {
      this.lock.lock();
      LOG.debug("IN");
      //.. do someting large
      LOG.debug("OUT");
      this.lock.unlock();
  }
  </code></pre>
  
  <p>I've took a look on logs and two threads has entered inside protected code:</p>
  
  <pre><code>http-nio-8080-exec-3 =================IN=================  
  ...
  http-nio-8080-exec-10 =================IN================= 
  </code></pre>
  
  <p>Any ideas?</p>