ProcedureStatement does not follow JDBC spec for processing result sets
-----------------------------------------------------------------------

         Key: IBATIS-146
         URL: http://issues.apache.org/jira/browse/IBATIS-146
     Project: iBatis for Java
        Type: Bug
  Components: SQL Maps  
    Versions: 2.0.9b    
    Reporter: John Didion


CallableStatement API documentation: "For maximum portability, a call's 
ResultSet objects and update counts should be processed prior to getting the 
values of output parameters".

The problem occurrs when calling SqlExecutor.executeQueryProcedure() on a 
stored procedure that returns at least one result set as well as output 
parameters. Some drivers handle this fine, but a driver coded to the letter of 
the JDBC spec will not.  The code should look something like this:

<pre>
errorContext.setMoreInfo("Check the statement (update procedure failed).");
rs = cs.executeQuery();

errorContext.setMoreInfo("Check the results (failed to retrieve results).");
handleResults(request, rs, skipResults, maxResults, callback);

// consume additional results
while (cs.getMoreResults());

errorContext.setMoreInfo("Check the output parameters (retrieval of output 
parameters failed).");
retrieveOutputParameters(cs, mappings, parameters);
</pre>

If you want to test this, try using the jTDS driver.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to