It's interesting that they use that as an example, because that wouldn't even really do a batch. In recent discussions, it was shown that iBATIS only batches the same statements. "insertAccount" and "insertAddress" would likely not be the same SQL statement, so they would each be in their own batch.
Subject: RE: iBATIS Batching with Spring DAO Date: Wed, 5 Mar 2008 08:41:19 -0700 From: [EMAIL PROTECTED] To: [email protected] Did u check Spring-reference.pdf. The batching of Ibatis has been explained in page 296. public class SqlMapAccountDao extends SqlMapClientDaoSupport implements AccountDao { public void insertAccount(Account account) throws DataAccessException { getSqlMapClientTemplate().execute(new SqlMapClientCallback() { public Object doInSqlMapClient(SqlMapExecutor executor) throws SQLException { executor.startBatch(); executor.update("insertAccount", account); executor.update("insertAddress", account.getAddress()); executor.executeBatch(); } }); } } -S From: Jesse Reimann [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 05, 2008 8:19 AM To: [email protected] Subject: iBATIS Batching with Spring DAO Could someone explain to me how-to do iBATIS batching when using Spring DAO? I’ve been reading and searching and can’t seem to find an example out there on how to actually do it. I’m using Abator to generate my Spring DAO classes and I’ve got it working with no issues. I read that using Spring that you are effectively setting the TransactionManager type to EXTERNAL so I also setup a Spring Transaction Manager as discussed in this thread: http://markmail.org/message/cjqctvogweyoykih . Has anyone else implemented batching in iBATIS with a similar setup and can point me in the right direction? Thanks, Jesse Reimann _________________________________________________________________ Shed those extra pounds with MSN and The Biggest Loser! http://biggestloser.msn.com/
