You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-cs@ibatis.apache.org by "Tan, Lee" <Le...@qg.com> on 2007/04/19 23:49:25 UTC

FW: Batched Statements

What is the interest in trying to implement this in iBatis?
http://ayende.com/Blog/archive/2006/09/13/7276.aspx has some good
statistics on possible performance gains accessing these included
batching methods via reflection and delegates.

We're looking at the same problems and right now the prevailing winds
are pushing us to use iBatis only for Selects, all Updates, Inserts, or
Deletes would be handled manually like Ron suggested below, and I'd like
to avoid that.

Thoughts?

-----Original Message-----
From: Clough, Samuel (USPC.PRG.Atlanta)
[mailto:Samuel_Clough@princetonrg.com]
Sent: Thursday, January 04, 2007 7:06 AM
To: user-cs@ibatis.apache.org
Subject: RE: Batched Statements

That's helpful, but I was looking to see if there was going to be a way
to do it in iBatis.  IIRC, NHIbernate has a way to do it, but them
Nhibernate so abstracts the sql I may be thinking of something else. It
would be nice to just call something like BeginBatch on the datamapper
and then FlushBatch to execute the statements.  Since I'm using iBatis,
I'd rather keep all the sql in iBatis so that everything's clean.  If I
have to batch up raw sql statements myself then I'm losing the benefits
of iBatis.

Just thinking out loud, it would also be a nice trick if when you had an
update, insert, delete, etc statement where the parameter class was a
domain object if you could pass an array of domain objects and iBatis
would automatically loop over each object and execute the statement for
each object in the array, again preferably in a batch if possible.  I
know that would not be obvious, but it might be a nice trick if you need
to so several inserts of the same type like I do on a current project. 

-----Original Message-----
From: Ron Grabowski [mailto:rongrabowski@yahoo.com]
Sent: Wednesday, January 03, 2007 4:53 PM
To: user-cs@ibatis.apache.org
Subject: Re: Batched Statements

Batching is a new feature of ADO.Net's 2.0 DataAdapter class:

http://davidhayden.com/blog/dave/archive/2006/01/05/2665.aspx

I believe JDBC natively supports batching.

When it makes sense to batch things I usually use a StringBuilder and
build the raw sql statements myself.

----- Original Message ----

From: "Clough, Samuel (USPC.PRG.Atlanta)"
<Sa...@princetonrg.com>

To: user-cs@ibatis.apache.org

Sent: Wednesday, January 3, 2007 3:45:00 PM

Subject: Batched Statements



         I noticed that there  is an ability in the Java version to
batch statements.  So far I have been  unable to find that ability in
iBatis by looking around or by searching google,  the mailing list
archives, etc.  Is there some way to batch statements that  I have
missed?  If not is it planned for a future  release? 
--------------------------------------------------------

Princeton Retirement Group, Inc - Important Terms This E-mail is not
intended for distribution to, or use by, any person or entity in any
location where such distribution or use would be contrary to law or
regulation, or which would subject Princeton Retirement Group, Inc. or
any affiliate to any registration requirement within such location. 
This E-mail may contain privileged or confidential information or may
otherwise be protected by work product immunity or other legal rules. No
confidentiality or privilege is waived or lost by any mistransmission.
Access, copying or re-use of information by non-intended or
non-authorized recipients is prohibited. If you are not an intended
recipient of this E-mail, please notify the sender, delete it and do not
read, act upon, print, disclose, copy, retain or redistribute any
portion of this E-mail. 
The transmission and content of this E-mail cannot be guaranteed to be
secure or error-free. Therefore, we cannot represent that the
information in this E-mail is complete, accurate, uncorrupted, timely or
free of viruses, and Princeton Retirement Group, Inc. cannot accept any
liability for E-mails that have been altered in the course of delivery.
Princeton Retirement Group, Inc. reserves the right to monitor, review
and retain all electronic communications, including E-mail, traveling
through its networks and systems (subject to and in accordance with
local laws). If any of your details are incorrect or if you no longer
wish to receive mailings such as this by E-mail please contact the
sender by reply E-mail. 

--------------------------------------------------------