title: TX-row lock contention : Inserting Duplicate values for Unique Key
body: <p>We are getting a <strong>TX-row lock contention</strong> error while trying to insert data</p>
  
  <p>It happens while running a job which processes an xml with almost 10000 records, inserting the data into a table</p>
  
  <p>We are having a unique key constraint on one of the columns in the table, and in the request we are getting duplicate values. This is causing the locks and thereby the job is taking more time.</p>
  
  <p>We are using hibernate and spring. The DAO method we use is hibernate template's 'save' annotated with Spring Transaction Manager's @Transactional</p>
  
  <p>Any suggestions please?</p>