473,320 Members | 1,900 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

JDBC batch inserts seem very slow.

We are prototyping an application that is inserting 500 rows into a
table. One method is to using batching and make one database call to
insert all 500 rows, the other method is to make 500 database calls
insert 1 row each time. The problem is that the batching method is
about 20% slower. Does anyone have any insights as to why this is the
case? I was expecting the batching to be faster.

DB2 9 on AIX 5.3 64 bit.

Thanks!

Aug 23 '06 #1
2 2347
"Private Pyle" <lp*****@gmail.comwrote in message
news:11*********************@m79g2000cwm.googlegro ups.com...
We are prototyping an application that is inserting 500 rows into a
table. One method is to using batching and make one database call to
insert all 500 rows, the other method is to make 500 database calls
insert 1 row each time. The problem is that the batching method is
about 20% slower. Does anyone have any insights as to why this is the
case? I was expecting the batching to be faster.

DB2 9 on AIX 5.3 64 bit.

Thanks!
Can you explain exactly what you mean by batching, and provide a sample of
your insert?
Aug 23 '06 #2
On Wed, 23 Aug 2006 14:55:20 -0700, Private Pyle wrote:
We are prototyping an application that is inserting 500 rows into a
table. One method is to using batching and make one database call to
insert all 500 rows, the other method is to make 500 database calls
insert 1 row each time. The problem is that the batching method is
about 20% slower. Does anyone have any insights as to why this is the
case? I was expecting the batching to be faster.

DB2 9 on AIX 5.3 64 bit.

Thanks!
In my case, on 64 bit Linux server, 32 bit Linux clients, (also 9.1) there
is a huge improvement when using jdbc batch inserts. Possibly your client
IBM jdbc drivers (ver 9.1 has new drivers).
Also, maybe your jvm needs more ram (jdbc uses more ram for all records in batch,
as opposed to releasing each to gc the regular way) and is the bottleneck.
-nat

Aug 23 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Steve | last post by:
Hi; I went to the microsoft site to try to find a guide to the error messages that the jdbc drivers give ( for sqlserver 2000 ). I had no luck. Does anyone know if there is such a guide? ...
2
by: Paul Reddin | last post by:
Hi, (V8.1 Fp2) Our application uses JDBC batch to execute mutiple insert statements and we saw a strange thing this morning. There were 4 SQL Insert statements in the batch, and we know the...
17
by: VM | last post by:
In my Windows app, I'm running a batch process that's composed of a FOR loop that'll run 15,000 times (datatable row count), copy cthe data of each row -3 fields- to a struct, and send the strct to...
0
by: bunty.gopal | last post by:
I am trying to use the PreparedStatement's addBatch to load data in an ETL-like process into a table. There is a single prepared statement. The parameters are set on it and prepStmt.addBatch() is...
2
by: Diego | last post by:
Hi everybody! I'm using DB2 PE v8.2.3 for linux. I've defined a database with the following schema: ANNOTATION(ID,AUTHOR,TEXT) ANNOTATION_BOOK(ANNOTATION_ID,OBJECT_ID)...
0
by: JSParker1 | last post by:
Has anybody ever seen a situation where the database is rollback transaction (due to resource limits being bust) but the JDBC Driver is NOT throwing an exception!!!! The system is writing...
1
by: bunty.gopal | last post by:
This is the solution to the issue in the subject, question itself was posted in a previous thread long back. Use the latest DB2 db2cc.jar fixpack on the client, or add "deferPrepares=false" to...
1
by: chicago1985 | last post by:
I am always checking if any of my JDBC has Database leaks with our Oracle 9i database. Here is what I use in SQL Plus: select username, program from v$session where username = 'myUserSchemaName';...
0
by: neuraljay | last post by:
hi everyone. I am trying to build a jsp using webwork, hibernate and mysql. And right now I am doing its unit testing. Everytime I run the test I am getting this error: Error JDBC exception on...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.