title: hibernate SQLIntegrityConstraintViolationException
body: <p>I have an oracle table with a unique contraint on a few fields. 
  I am writing a piece of code to import data to that table from large excel files (thousands of rows usually). The whole import has to be in one transaction.</p>
  
  <p>It might happen that in that thousands of rows there will be one or two rows duplicated. So I need to ignore SQLIntegrityConstraintViolationException and continue inserting all other rows. I just need to show message to the user that the rowNo 123 is a duplicate entry. </p>
  
  <p>I am reading the excel file row by row (Apache POI event based), and each row is maped to hibernate POJO and saved right away:</p>
  
  <pre><code>public void saveRow( ExcelRow row) {
    TableRow tableRow = new TableRow(row);
    //some logic goes here
    this.session.save(tableRow);
  }
  </code></pre>
  
  <p>I tried to suround session.save with </p>
  
  <pre><code>try{
      session.save(tableRow);
  }catch(SQLIntegrityConstraintViolationException e)
  {
      //push the error message and continue
  }
  </code></pre>
  
  <p>But Netbeans cries that <code>exception SQLIntegrityConstraintViolationException is never thrown in body of corresponding try statement</code>.</p>
  
  <p>How to catch and ignore the integrity exception to continue processing data?</p>
  
  <p>I would rather not have to execute another 10K selects to check if similar row exists.</p>