By using a static class intilizer in the DAO, JNDI, Pool and XML phrase happen once for the entire web app.
iBatis I found much faster and simpler that others.


.V

Jerry Jalenak wrote:
Matt -

After reading your post here and on the iBatis forum on SF, I thought I'd
run some tests on my authentication process as well.  I'm using a static
block to initially read in the sql-map.xml file, and am using the
sqlMap.executeQueryForObject method w/o a 'true' DAO (calling the method
directly from my business model).  Here's what I found:

        first call to initialize (read) the sql-map.xml file:           .688
        first call to executeQueryForObject:                    6.485
(ouch!)
        subsequent calls to executeQueryForObject:              .031 - .032
(tested multiple times)

I think this agrees with what you saw, and with what Clinton indicated - the
first call is *really* slow due to the additional initialization that
occurs.  Once that is complete, iBatis seems to be a fast as native JDBC...


Jerry Jalenak Team Lead, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496

[EMAIL PROTECTED]



-----Original Message-----
From: Matt Raible [mailto:[EMAIL PROTECTED]
Sent: Monday, September 08, 2003 6:13 PM
To: 'Struts Users Mailing List'
Subject: RE: Converting a ResultSet to a List of POJOs


Thanks to all for your suggestions. I did some number comparisons b/w the
"standard" way (rs.next() ... set, set, set), ibatis, and
ResultSetUtils.getCollection() from scaffold. Here's what I found:


1. Standard way - 0.24 seconds
2. ibatis - 5+ seconds (ugh! - maybe I'm doing something wrong, more info
here: http://tinyurl.com/mod4)
3. ResultSetUtils.getCollection - 0.27 seconds


So I'm going with #3 as it'll speed up dev time and doesn't have much of a
performance hit.


Thanks,

Matt

-----Original Message-----
From: Jerry Jalenak [mailto:[EMAIL PROTECTED]
Sent: Monday, September 08, 2003 7:09 AM
To: 'Struts Users Mailing List'
Subject: RE: Converting a ResultSet to a List of POJOs


+1. Simplest method I've seen to go from a ResultSet to a Collection of
JavaBeans....


Jerry Jalenak
Team Lead, Web Publishing
LabOne, Inc.
10101 Renner Blvd.
Lenexa, KS  66219
(913) 577-1496

[EMAIL PROTECTED]



-----Original Message-----
From: Ted Husted [mailto:[EMAIL PROTECTED]
Sent: Saturday, September 06, 2003 10:34 AM
To: Struts Users Mailing List
Subject: Re: Converting a ResultSet to a List of POJOs


I'm about to try iBATIS <www.ibatis.com> for a new phase of a project we started in Hibernate. Hibernate is cool, but I think something simpler might be a better fit. (Not sure if we really need that finely grained object layer after all :)


It will let you remove the SQL to a simple XML file and give that statement a name. You can then call the named statement from your Java code and get a POJO result. Like what I was doing in Scaffold, only better =:0)

-Ted.

Matt Raible wrote:

Dear Struts Experts,

I recently started a new project where most of the backend

code is already


written with JDBC and ResultSets. The ResultSets are

iterated through and a


POJOs values are set using

pojo.setName(rs.getString("...")), etc. - you get


the point. I'm wondering if there's an easier way - so I

could do something


like this:

ResultSet rs = stmt.executeQuery("SELECT ...");
List objects = FancyUtilitity.convertResultSetToListOfObjects(rs,
object.class);

Hibernate let me do this very simply - and I miss the fact

that I could type


a line or two to get a List of POJOs.

 List users = ses.createQuery("from u in class " + User.class
                              + "order by u.name").list();

I've looked at the RowSetDynaClass

(http://tinyurl.com/mekh), which has an


interesting way of doing this - is this the "recommended"

approach in the


JDBC world? Here's an example using it:

  ResultSet rs = stmt.executeQuery("SELECT ...");
  RowSetDynaClass rsdc = new RowSetDynaClass(rs);
  rs.close();
  stmt.close();
  ...;                    // Return connection to pool
  List rows = rsdc.getRows();
  ...;                   // Process the rows as desired


Thanks,


Matt



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

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:

[EMAIL PROTECTED]



--
Ted Husted,
Junit in Action - <http://www.manning.com/massol/>,
Struts in Action - <http://husted.com/struts/book.html>,
JSP Site Design - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.






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


To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



This transmission (and any information attached to it) may be confidential
and is intended solely for the use of the individual or entity to which it
is addressed. If you are not the intended recipient or the person
responsible for delivering the transmission to the intended recipient, be
advised that you have received this transmission in error and that any use,
dissemination, forwarding, printing, or copying of this information is
strictly prohibited. If you have received this transmission in error, please
immediately notify LabOne at the following email address:
[EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at the following email address: [EMAIL PROTECTED]



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to