ibatis-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Diekelman (JIRA)" <ibatis-...@incubator.apache.org>
Subject [jira] Commented: (IBATIS-142) JDBC 3 Generated Keys Support
Date Mon, 25 Feb 2008 02:00:58 GMT

    [ https://issues.apache.org/jira/browse/IBATIS-142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12571999#action_12571999

Brian Diekelman commented on IBATIS-142:

I've been working on the java_release_2.3.0-677 tag.  The trunk appeared to have a lot of
changes to it and I wanted a clean patch that could be applied to the latest release.

The biggest problem thus far is how deep the actual PreparedStatement.execute() is called:


That last call prepares a PreparedStatement, calls execute(), gets the update count, then
closes it.  Great for efficiency, bad if we need to get generated keys from the PreparedStatement
before it's closed.

My plan now is to add: afterExecute(RequestScope request, PreparedStatement) to InsertStatement
to be called by SqlExecutor.executeUpdate() if the MappedStatement in the RequestScope is
an instance of InsertStatement.

The majority of my time so far has been finding the most non-intrusive way to add this without
any unintended consequences affecting the otherwise stable codebase.  Hopefully I'll have
a couple more hours to work on this over the next few days, if not it'll be my project for
next weekend.

> JDBC 3 Generated Keys Support
> -----------------------------
>                 Key: IBATIS-142
>                 URL: https://issues.apache.org/jira/browse/IBATIS-142
>             Project: iBatis for Java
>          Issue Type: Improvement
>          Components: SQL Maps
>            Reporter: Brandon Goodin
>            Priority: Minor
> public int executeUpdate(String sql,int autoGeneratedKeys)
> public boolean execute(String sql,int autoGeneratedKeys)
> public ResultSet getGeneratedKeys()
> We should provide support for jdbc auto generated keys retrieval. This is only available
in Java 1.4. So, we would have to throw an UnsupportedFeatureException if 1.3 or earlier was
being used.
> Brandon

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message