ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Harvey Kim" <cash...@fastmail.fm>
Subject Re: Exit out of rowHandler
Date Wed, 30 Jan 2008 00:23:36 GMT
Thanks, I'm currently throwing an exception but that is really ugly.  I
was hoping for more "graceful" solution.  But I guess I can live with
it.  Oh, and "Cancel" button won't be a problem - I got that covered.

Another thing - I've issued this question few months back but there ws
no reply.  Does anybody know anything about memory leak problem when
using the RowHandler?  After processing about 200,000 rows or so, I
noticed that "available memory" starts to decrease.  This is more
prevalent when using a "groupBy" clause.  When I took out the groupBy
clause, memory leak appeared to go have gone away but it slowly started
appearing at 200,000th row (give or take few thousands).  

Just for kicks, I converted everything to JDBC with exactly the same
code and it successfully processed 1 million rows with absolutely no
memory leaks.  Meaning, instead of calling ibatis with RH, I simply put
it in a loop after issuing the same SQL generated by ibatis via JDBC. 
Meaning, my code was exactly the same except instead of being inside the
"handleRow", it was inside the loop.  With this evidence, I became
suspicious of the ibatis RH.

I guess what I'm asking is if anybody ever successfully processed
millions of row using RH without a memory leak .  I'd hate to resort
back to JDBC when ibatis makes everything so much easier.

I'd appreciate any input,



On Tue, 29 Jan 2008 16:52:02 -0700, "Larry Meadors"
<lmeadors@apache.org> said:
> On Jan 29, 2008 4:34 PM, Harvey Kim <cashtag@fastmail.fm> wrote:
> > Anybody know how to gracefully exit out of "handleRow" method?  Before
> > anybody suggests using "queryFor*" methods, I need to be able to query
> > for potentially 12 million rows.  It's a straight download to an excel
> > file so nothing is being displayed (thank god).  Anyway, I'm trying to
> > exit out of "handleRow" method when the user clicks on the "cancel"
> > button from the standard download dialogue box.
> Hm, red flag there - I assume you're talking web app, but I don't
> think the request is canceled when the user clicks on the cancel
> button, it'll still going to run.
> In any case, the only current way to cancel RH processing is to throw
> an exception from the handleRow method. Not sexy, but it works. :-)
> Larry

http://www.fastmail.fm - Email service worth paying for. Try it for free

View raw message