ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <robert.kasani...@accenture.com>
Subject RE: how to map huge resultsets?
Date Wed, 03 Oct 2007 21:33:54 GMT

Thanks for your reply.

I can't use the rowhandler callback because the iteration is external to iBATIS. In my case
a batch framework iteratively asks for an item and processes it - and I am trying to implement
an iBATIS item provider (I realize now I should have explained this in the initial post).

Robert 


-----Original Message-----
From: Christopher Lamey [mailto:clamey@localmatters.com]
Sent: Wed 10/3/2007 11:06 PM
To: user-java@ibatis.apache.org
Subject: Re: how to map huge resultsets?
 
Hello,

You should take a look at the RowHandler interface and the
queryWithRowHandler calls in SqlMapClient (page 61 of the pdf).  Basically,
the RowHandler gets invoked for every row returned rather than mapping all
the rows into objects in a collection.

Cheers,
Chris


On 10/3/07 2:37 PM, "robert.kasanicky@accenture.com"
<robert.kasanicky@accenture.com> wrote:

> Hello,
> 
> I am wondering whether it possible to implement the following scenario with
> iBATIS:
> 
>    1. run an iBATIS-managed select
>    2. get a scrollable result set instead of a list of mapped objects
>    3. manually scroll the result set and ask iBATIS for object corresponding
> to current row 
> 
> Hibernate provides this possibility
> (http://www.hibernate.org/hib_docs/reference/en/html/batch.html) so I thought
> it would be feasible with iBATIS too, but I couldn't figure out a way. The
> motivation is a batch scenario where the select returns a huge number of rows
> so all mapped objects can't be loaded into memory at once.
> 
> The iBATIS way I am aware of is to use queryForList(String statementName, int
> skipResults, int maxResults), but this means querying the database
> (TOTAL_NUMBER_OF_ROWS / maxResults) times.
> 
> Can somebody give advice about pros & cons of the two approaches?
> 
> Thanks
> Robert
> 
> 
> This message is for the designated recipient only and may contain privileged,
> proprietary, or otherwise private information.  If you have received it in
> error, please notify the sender immediately and delete the original.  Any
> other use of the email by you is prohibited.




This message is for the designated recipient only and may contain privileged, proprietary,
or otherwise private information.  If you have received it in error, please notify the sender
immediately and delete the original.  Any other use of the email by you is prohibited.

Mime
View raw message