ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mkhitaryan, Aram" <Aram.Mkhitar...@lycos-europe.com>
Subject RE: Is PreparedStatement reused on insert?
Date Thu, 03 Aug 2006 04:54:34 GMT
Do you have dynamic parts in your insert?

First start transaction and only then use batch.

Maybe hsqldb doesn't support PreparedStatements in real?
Add this parameter in your db url "cachePrepStmts=true" (for example, jdbc:mysql://localhost:3306/test?allowMultiQueries=true&cachePrepStmts=true).

Maybe this can help


Aram Mkhitaryan

Lycos Armenia CJSC
9 Alex Manukyan str,
Yerevan 375070, Armenia
Tel:	 +374 10 512411
Mobile: +374 91 518456
E-mail:	 aram.mkhitaryan@lycos-europe.com
Web:	 www.lycos-europe.com 

-----Original Message-----
From: Kenji Nakamura [mailto:nakamura.kenji@gmail.com] 
Sent: Wednesday, August 02, 2006 8:52 PM
To: user-java@ibatis.apache.org
Subject: Is PreparedStatement reused on insert? 


I'm evaluating iBatis 2.1.7, and encountered a performance problem.  
The benchmark is simply taking a sequential file with approximately  
16,000 lines, and populate them into HSQLDB ( with 20 lines  
of batch. I see iBatis version is two to three times slower than  
plain vanilla JDBC version.
I put a profiler, and it indicates  
com.ibatis.sqlmap.engine.execution.SqlExecutor#excuteUpdate() creates  
an instance of PreparedStatement every time calling  
SqlMapClient#insert(), and it is actually created at line 77 of the  
Is there a way to keep an instance of PreparedStatement for an Id and  
reuse it? At least creation of PreparedStatement isn't a cheap  
operation in HSQLDB, which takes up 51% of whole execution time in my  

Thanks in advance,


View raw message