title: LOCK TABLE and try-catch block
body: <p>Inside a method annotated with <code>@Transactional</code>, should a <code>LOCK TABLE</code> statement be executed inside the <code>try</code> block or before it?</p>
  
  <p><strong>Option 1:</strong></p>
  
  <pre><code>jdbcTemplate.execute(SQL_LOCK);
  
  try {
      //Some work
  } finally {
      jdbcTemplate.execute(SQL_UNLOCK);
  }
  </code></pre>
  
  <p><strong>Option 2:</strong></p>
  
  <pre><code>try {
      jdbcTemplate.execute(SQL_LOCK);
  
      //Some work
  } finally {
      jdbcTemplate.execute(SQL_UNLOCK);
  }
  </code></pre>
  
  <p>Thanks,
  Mickael</p>