Hi Tegan,

 

I once made a feature request for something like this:

 

http://issues.apache.org/jira/browse/IBATIS-206

 

It didn’t receive any serious consideration though, perhaps more on grounds
of ideology than of practicality.

 

The basis of my request was that if we have the RowHandler facility, why
don’t we have disconnected ResultSets too?  Paradigmatically, they are the
same – except that iBatis’s RowHandler is a much abstracted high level
interface.  With disconnected ResultSets we can access meta-data objects too
(something we currently can’t do with iBatis).  I have since been working
with my own patched version of iBatis to support my requirements vis-à-vis
disconnected ResultSets.  No problems. 

 

If you are going to do something similar, just note that returning the
true-blue JDBC ResultSet (the non-serializable one) from iBatis should be
avoided because JDBC ResultSets are linked to implicit connection objects to
your database.  Even though you won’t be able to transfer your “connected”
JDBC Resultset across process boundaries, you still don’t want them to be
passed around in your DAL.  Rather work with disconnected versions of them.
(Also, SqlMapClient already abstracts the connection details for you nicely
and allows you to control transactions too.)  

 

So, what you may want to have a look at are *disconnected* Resultsets via
JDBC 3.0’s CachedRowSet interface (and all the other incarnations WebRowSet
etc).  This way you can bypass all the ResultSet-to-object mapping overhead
too – if you don’t need it. 

 

Hope that helps,

 

Kind regards,

 

Abdullah

 

 

 

  _____  

From: Tegan Clark [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 04, 2007 10:02 PM
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 <[EMAIL PROTECTED]> 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 

Reply via email to