ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DavidR <david.rosenst...@corp.idt.net>
Subject Re: batch insert autocommit setting
Date Tue, 15 Aug 2006 12:59:38 GMT

Let me restate the issue.
I have an application that is doing inserts.
I am changing one parameter -- the defaultAutocommit setting in the
application.
when i set it to false, the inserts are about 30 a second.
When i set it to true, the inserts are 100+ a second.
Thus, the question is not about my code or implemetation.
Woudl i see a difference in performance if i did startBatch with autocommit
or not?
This is what is unclear to me since i do not change any other lines in the
application.

David


Koka Kiknadze wrote:
> 
> On 8/15/06, DavidR <david.rosenstark@corp.idt.net> wrote:
>>
>>
>> I thought i saw around the forums that Ibatis automatically deals with
>> this
>> behind the scenes?
>> Anyway, I cut down my test case to 1000 rows.
>>
>>
>>
> Well, imo ibatis automatically deals with this in the sense that it will
> batch everything between your startBatch executeBatch calls. So when
> inserting thousands of rows you'd better issue executeBatch and commits
> periodically. Usually the optimal number of rows to be batched is
> detrmined
> experimentally (e.g. if I remember it right Oracle recommends some 20-30,
> though in my app 1000 performed better). Anyway, I think you should try
> profiling your app first to make sure that it's indeed database operation
> that slows things down. If it turns out that it's batch inserts that are
> performing poorly than I'd try maybe using some other JDBC driver (i.e.
> blame the driver)...
> 
> 

-- 
View this message in context: http://www.nabble.com/batch-insert-autocommit-setting-tf2108481.html#a5813616
Sent from the iBATIS - User - Java forum at Nabble.com.


Mime
View raw message