title: Low performance of subsequent query with the same table using UCanAccess
body: <p>I am trying to update approx. 3800 rows in a table in two steps:</p>
  
  <ol>
  <li>set all values to 0</li>
  <li>set some of them in a loop to a calculated value</li>
  </ol>
  
  <p>The first step is fast (&lt; 1 s). However the second step takes around 3 s. Maybe there is some problem in the code, because if I run the code without the first step or run the first query on another table, the second step is very fast, too (&lt; 0.1 s). It is slow only when executed after the first step on the same table.</p>
  
  <pre><code>Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
  conn = DriverManager.getConnection("jdbc:ucanaccess://" 
          + path +;singleconnection=true" ,"", ""); 
  
  // First update (reset all values)
  long start = System.currentTimeMillis();         
  PreparedStatement ps2 = conn.prepareStatement("UPDATE mytab SET val = 0.0;"); 
  ps2.executeUpdate();
  ps2.close();
  System.out.println("Update 1: " + (System.currentTimeMillis()-start)/1000.0 + " s");
  
  // Second update
  start = System.currentTimeMillis();
  conn.setAutoCommit(false);
  int count = 0;
  PreparedStatement ps = conn.prepareStatement("UPDATE mytab SET val = ? WHERE id = ?;");
  
  for(int j= 1; j &lt;= 3600; j++){
        double value;
        // calculate some value ....
        value = 1.3;
        // update table under certain conditions
        if(true){
                ps.setDouble(1, value);
                ps.setInt(2, j);
                ps.addBatch();
                count++;
         }
         if(count &gt; 200){
                 ps.executeBatch();
                 count = 0;
          }
  }
  ps.executeBatch();
  conn.commit();
  System.out.println("Update 2: " + (System.currentTimeMillis()-start)/1000.0 + " s");
  </code></pre>
  
  <p>Why does the second step take so long? How to avoid this?</p>
  
  <p>(I asked the same question <a href="http://sourceforge.net/p/ucanaccess/discussion/help/thread/a7feb44e/" rel="nofollow noreferrer">here</a> already but without success).</p>
  
  <p><strong>Edit</strong>:
  If I try the two queries with the old JDBC-ODBC bridge (and Java 7) the second query is very fast (&lt; 1 s) when executed after the first. So I think it must be some UCanAccess problem.</p>