Thanks for this thread, I have read it before :-)

You are right, doing a performance test, I made a for-loop using jdbc vs. ibatis. And I used startTransaction etc. The code looks anything like this:

sqlMap.startTransaction();
for-loop, inserting data using ibatis; doing sqlMap.commitTransaction() every 1000 inserts
sqlMap.commitTranscation() after the last insert
sqlMap.endTransaction();

Or is it necessary to start a transaction every 1000 inserts?

By the way, using "plain jdbc-statements", I did the same (without start- and end transaction of course).

Clinton Begin schrieb:

Yay! It's our monthly performance concern! Rest assured, for 99% of cases, iBATIS is within milliseconds of JDBC performance.

This comes up once a month, where someone creates a couple of for{} loops with JDBC vs. iBATIS....

9 times out of 10 the code is the problem -- inappropriate transaction handling, is the most common mistake.

In any case, you might want to read this thread.

http://www.mail-archive.com/[email protected]/msg04760.html

The key point:  "
When I excluded the
startTransaction/commitTransaction/endTransaction...my process took 5
minutes to run.  When I included it, I got my full process to run under 1

minute.  This is directly equal to the speed I found when using straight
Jdbc and/or Spring Jdbc Templates.
"

Batching and reflection optimization are icing on the cake. Even without them, iBATIS should be nearly as fast as JDBC ( i.e. not noticably slower).

Cheers,
Clinton

On 9/1/06, *Ralf Assmann* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:


    Hi there,

    making a performance test with ibatis, we got a very slow runtime.
    Inserting 100000 rows into a table, we took more than twice the time
    than using own-written prepared statements. The time was definitely
    lost during the transaction time writing the data to the database,
    calling sqlMap.insert(...).

    Does anyone know if this runtime is normal while using ibatis or is
    there any xml-parameter to optimize it?

    Many thanx,


    Ralf


Reply via email to