title: Java Multithreading: Informix 12.10 - Could not do a physical-order read to fetch next row
body: <p>We are using informix 12.10 version. We are deleting multiple rows of records across 54 tables from Java batch. we are using callable strategy in Multi-threading.
  Please refer to the below code:
  SampleImpl.java:</p>
  
  <pre><code>Callable&lt;Integer&gt; callable=null;
  List&lt;Callable&lt;Integer&gt;&gt; taskList = null;
  List&lt;Future&lt;Integer&gt;&gt; futureList = null;
  for (Map.Entry&lt;String, String&gt; entry : datas.entrySet()){
      callable = new Callable&lt;Integer&gt;(){
          public Integer call() throws Exception {
              return sampleDel.callSqlDelete();
          }
      };
      taskList.add(callable);
  }
  </code></pre>
  
  <p>SampleDaoImpl:</p>
  
  <pre><code>public void callSqlDelete(){
      Statement stmt = null;
      connection.setAutoCommit(false);
      stmt = connection.createStatement();
      stmt.execute("SET LOCK MODE TO WAIT");
      stmt.addBatch("DELETE FROM TABLE1 WHERE col1 IN(select from tableAAA where id=101)");
      stmt.addBatch("DELETE FROM TABLE2 WHERE col1 IN(select from tableAAA where id=101)"");
      int delCnt[] = stmt.executeBatch();
      connection.commit();
  }
  </code></pre>
  
  <p>In our java code we have already set lock mode to wait to infinite time interval but still we are getting the below exception:</p>
  
  <pre><code>    java.sql.BatchUpdateException: Could not do a physical-order read to fetch next row.
          at com.informix.jdbc.IfxStatement.executeBatch(IfxStatement.java:1650)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at oracle.ucp.jdbc.proxy.StatementProxyFactory.invoke(StatementProxyFactory.java:272)
          at com.sun.proxy.$Proxy1.executeBatch(Unknown Source)
          at com.sample.samplereport.dao.impl.SampleDAOPurgeImpl.processDelByStmts(SampleDAOPurgeImpl.java:1305)
          at com.sample.samplereport.util.SamplePlSqlDeleter.callSqlDelete(SamplePlSqlDeleter.java:58)
          at com.sample.samplereport.dao.impl.SampleDAOPurgeImpl$1.call(SampleDAOPurgeImpl.java:298)
          at com.sample.samplereport.dao.impl.SampleDAOPurgeImpl$1.call(SampleDAOPurgeImpl.java:1)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
          at java.util.concurrent.FutureTask.run(FutureTask.java:138)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
          at java.lang.Thread.run(Thread.java:662)
  </code></pre>
  
  <p>Please help on the above issue?</p>