title: Ibatis startBatch() only works with SqlMapClient's own start and commit transactions, not with Spring-managed ones
body: <p>I'm finding that even though I have code wrapped by Spring transactions, and it commits/rolls back when I would expect, in order to make use of JDBC batching when using Ibatis and Spring I need to use explicit SqlMapClient transaction methods.</p>
  
  <p>I.e. this does batching as I'd expect:</p>
  
  <pre><code>dao.getSqlMapClient().startTransaction();
  dao.getSqlMapClient().startBatch();
  
  int i = 0;
  for (MyObject obj : allObjects)
  {
      dao.storeChange(obj);
  
      i++;
      if (i % DB_BATCH_SIZE == 0)
      {
          dao.getSqlMapClient().executeBatch();
          dao.getSqlMapClient().startBatch();
      }
  }
  
  dao.getSqlMapClient().executeBatch();
  dao.getSqlMapClient().commitTransaction();
  </code></pre>
  
  <p>but if I don't have the opening and closing transaction statements, and rely on Spring to manage things (which is what I want to do!), batching just doesn't happen.</p>
  
  <p>Given that Spring does otherwise seem to be handling its side of the bargain regarding transaction management, can anyone advise on any known issues here?</p>
  
  <p>(Database is MySQL; I'm aware of the issues regarding its JDBC pseudo-batch approach with INSERT statement rewriting, that's definitely not an issue here)</p>