db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dave Sunerton-Burl (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DDLUTILS-2) DynaSql.query methods don't (can't?) free up JDBC resources
Date Mon, 08 Aug 2005 10:58:35 GMT
     [ http://issues.apache.org/jira/browse/DDLUTILS-2?page=all ]

Dave Sunerton-Burl updated DDLUTILS-2:

    Attachment: patch-DynaSqlIterator.txt

I think that the Iterator implementation is incorrect according to the spec of an Iterator.
This iterator depends on you calling hasNext() in order to advance the recordset. As I understand
it, the only method that should advance the iterator is the next() method. I know it's usual
to call hasNext() before next(), but it's not mandatory. Patch attached. I think also that
the _isAtEnd internal variable could be redundant and really this state should be retrieved
directly from the result set each time.

> DynaSql.query methods don't (can't?) free up JDBC resources
> -----------------------------------------------------------
>          Key: DDLUTILS-2
>          URL: http://issues.apache.org/jira/browse/DDLUTILS-2
>      Project: DdlUtils
>         Type: New Feature
>     Reporter: Dave Sunerton-Burl
>     Assignee: Thomas Dudziak
>     Priority: Minor
>  Attachments: patch-DynaSqlIterator.txt, patch-add-getCollection.txt
> See attached patch for a way round this.
> The new getCollection methods return a collection of populated DynaBeans based on an
SQL query (including the ability to set the start and end row number to return a subset of
the query). These methods clean up the connection, statement, and resultSet used before returning.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message