[ http://issues.apache.org/jira/browse/DERBY-1101?page=all ]
Knut Anders Hatlen updated DERBY-1101:
--------------------------------------
Attachment: testderby1101.java
Attaching a small program that tests what
EmbedResultSet40.getHoldability() returns when the result set is
returned from a stored procedure.
All combinations of the CallableStatement being holdable/non-holdable
and the statement inside the stored procedure being holdable or
non-holdable are tested. The program also tests whether it is possible
to do next() after commit().
Output from the test program:
Testing holdability -
Statement: HOLD_CURSORS_OVER_COMMIT
Procedure: HOLD_CURSORS_OVER_COMMIT
Internally in stored procedure:
ResultSet.getHoldability(): HOLD_CURSORS_OVER_COMMIT
ResultSet is in fact holdable
Externally:
ResultSet.getHoldability(): HOLD_CURSORS_OVER_COMMIT
ResultSet is in fact holdable
Testing holdability -
Statement: HOLD_CURSORS_OVER_COMMIT
Procedure: CLOSE_CURSORS_AT_COMMIT
Internally in stored procedure:
ResultSet.getHoldability(): CLOSE_CURSORS_AT_COMMIT
ResultSet is in fact not holdable
Externally:
ResultSet.getHoldability(): CLOSE_CURSORS_AT_COMMIT
ResultSet is in fact not holdable
Testing holdability -
Statement: CLOSE_CURSORS_AT_COMMIT
Procedure: HOLD_CURSORS_OVER_COMMIT
Internally in stored procedure:
ResultSet.getHoldability(): HOLD_CURSORS_OVER_COMMIT
ResultSet is in fact holdable
Externally:
ResultSet.getHoldability(): HOLD_CURSORS_OVER_COMMIT
ResultSet is in fact holdable
Testing holdability -
Statement: CLOSE_CURSORS_AT_COMMIT
Procedure: CLOSE_CURSORS_AT_COMMIT
Internally in stored procedure:
ResultSet.getHoldability(): CLOSE_CURSORS_AT_COMMIT
ResultSet is in fact not holdable
Externally:
ResultSet.getHoldability(): CLOSE_CURSORS_AT_COMMIT
ResultSet is in fact not holdable
For all these cases, the observed holdability is the same as the
holdability returned by getHoldability(). Hence, I don't think the
current implementation of getHoldability() returns wrong results when
using stored procedures.
> ResultSet.getHoldabilty will return incorrect value when the ResultSet is obtained from
a procedure call
> --------------------------------------------------------------------------------------------------------
>
> Key: DERBY-1101
> URL: http://issues.apache.org/jira/browse/DERBY-1101
> Project: Derby
> Type: Bug
> Components: JDBC
> Versions: 10.2.0.0
> Reporter: Daniel John Debrunner
> Priority: Minor
> Attachments: testderby1101.java
>
> EmbedResultSet40.getHoldability returns the holdability of the statement returned by
ResultSet.getStatement().
> When a ResultSet is created by a procedure call, its holdability may not match the holdability
of the Statement that called the procedure, which is probably what ResultSet.getStatement()
should return.
> This may not be exposed as a bug yet, but I think this method should be directly obtaining
the holdability of the ResultSet using the Activation.getResultSetHoldability() method, rather
than through a Statement. Seems a safer approach.
--
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
|