title: java.sql.SQLException: ORA-00060: deadlock detected while waiting for resource
body: <p>I have a Java batch that runs on multi-threads (usually 16/32). There's a JDBC query that conditionally inserts/updates in a table. </p>
  
  <p>However, some of the records fail due to following error:</p>
  
  <pre><code>[CobolThread 34] ERROR (com.splwg.base.support.sql.PreparedStatementImpl) Error executing update for rawSQL:
  update TABLE_A s set s.INT_COL = s.INT_COL + 1 where s.PRIM_ID = ?
  with 'string' parameter named 'primId' to : '8741104958' to indices: 1
  java.sql.SQLException: ORA-00060: deadlock detected while waiting for resource
  </code></pre>
  
  <p>In this query, the PRIM_ID column is the Primary key column and there are no other indexes on this TABLE_A. I have gone through many blogs available around this and all they suggest is to avoid the usage of Bitmap index. In my case, there is no bitmap index neither there is any Foreign key involved.</p>
  
  <p>Note: We were using a MERGE statement prior to conditional Insert/Update but it too used to fail for the same reason.</p>
  
  <p>Please help me understand the cause of this issue.</p>