ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Parkinson" <pa...@avaning.com>
Subject RE: Performance question
Date Thu, 10 Jan 2008 21:52:27 GMT
Thanks Christopher!

I'll rip out the startTransaction, commit and endTransaction stuff from
the code (now that Spring is taking care of this).

One final question if you don't mind:

I wasn't quite sure in your answer whether the startBatch/executeBatch
should work properly under the setup I have now - I was assuming that
the performance problems I encountered were related (in part at least)
to the fact that the statements weren't being batched, but run
sequentially and so making many calls to the db. I'm just a little
confused on this point.

I'm off to run some performance tests.

Thanks again - very cool progress - spring and iBATIS are great.


> 3. Given that there is transaction support, then I'm assuming that
> getSqlMapClient().startTransaction();
> and
> getSqlMapClient().startBatch();
> will be properly honoured.

Actually, they won't.  The Spring SqlMapClientTemplate essentially does
a no-op on these calls - it assumes an external transaction manager will
handle everything for you outside of the code.  So what you can do is
just remove them from your code (including the commit and finally {
endTransaction }).

With the Spring declarative transaction handling, you can assume that
those are being called for you.  And if you chain methods that meet the
pointcut criteria, they will be wrapped in the same transaction as the
calling method
- pretty neat stuff.

View raw message