title: prevent period intersection in concurrent insert
body: <p>I have a table with fields: name|...|start_date|end_date</p>
  
  <p>My code now is:</p>
  
  <pre><code>select .... 'check for period intersection
  insert .... 'if check succesfull insert new row
  </code></pre>
  
  <p>This code in one transaction.
  When two users try to insert new record in the same time with same fields(and periods intersects) two records inserted. 
  But I want to avoid that inserting. First user must insert, other user must get conflict. 
  How can I do it ?</p>
  
  <p>P.S. I use IBM DB2</p>