ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Damien McCarthy" <damien.mccar...@propylon.com>
Subject RE: Getting straight at the ResultSet
Date Thu, 04 Jan 2007 20:27:51 GMT
Hi Tegan,

 

I'm not sure which overhead you are trying to avoid..

 

If you want to avoid loading 100,000 objects into memory at the same time,
then the RowHandler will do this for you. The row handler will walk along
the resultSet and for each row call handleRow. So you would expect this
method to be called 100,000 times. For example inside this method you could
put code to append some of the objects properties to a file. This gives you
the iterative approach you mentioned in your first mail.

 

If you want to avoid mapping the 100,000 rows to objects at any time then
why are you using ibatis at all?  Just use a direct JDBC connection.

 

Damien

 

From: Tegan Clark [mailto:tegan.clark@yahoo.com] 
Sent: 04 January 2007 20:02
To: user-java@ibatis.apache.org
Subject: RE: Getting straight at the ResultSet

 

Damien/Larry,

 

Thanks for the reply.  I've looked at RowHandler, and unless I'm missing
something iBATIS is still controlling the iteration and passing me a Map of
the underlying data, i.e. iBATIS first incures the overhead of adapting the
ResultSet to the Map, and then I must implement some sought of buffer to
hold the returned results (unless I implement some sought of callback out of
my DAL).

 

Do my assumptions above sound correct?

 

There's no way to map the ResultSet straight back? i.e:

 

   ResultSet res = (ResultSet ) sqlClient.queryForObject();

 

Thanks again.

 

Tegan

 


Damien McCarthy <damien.mccarthy@propylon.com> wrote:

 

I have a framework that uses iBATIS to product "no-code" reports (just the
xml).  Some of those reports can stretch to 100,000's or records though so
are better suited to an iterator approach and non-reflective mapping.

 

If it can't be done, is this something iBATIS would be interested in having
contributed?

 

All help greatly appreciated.  Thanks.

 

Tegan

 __________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

 

 __________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Mime
View raw message