db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel John Debrunner (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-2413) Derby allows duplicate cursor names for open PreparedStatements.
Date Wed, 07 Mar 2007 17:10:24 GMT

    [ https://issues.apache.org/jira/browse/DERBY-2413?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12478819

Daniel John Debrunner commented on DERBY-2413:

Yes, you are correct Julius, good eyes!

Couple of extra notes:

   - if setCursorName() fails then I think the statement should remain open with its cursor
name unchanged.

  - Having two Statement object exist with the same cursor name (but no open result sets)
is probably ok since that does not correspond to any SQL declaration of a cursor. 

> Derby allows duplicate cursor names for open PreparedStatements.
> ----------------------------------------------------------------
>                 Key: DERBY-2413
>                 URL: https://issues.apache.org/jira/browse/DERBY-2413
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client
>    Affects Versions:,,,,,
>            Reporter: Daniel John Debrunner
>            Priority: Minor
> The following code does not throw any exception in embedded and client: The second setCursorName
should throw an exception.
>         PreparedStatement ps1 = prepareStatement("SELECT I FROM T FOR UPDATE");
>         ps1.setCursorName("TEST_DUP");
>         PreparedStatement ps2 = prepareStatement("SELECT C FROM T FOR UPDATE");
>         ps1.setCursorName("TEST_DUP");
> If a prepare of a statement corresponds to a DECLARE CURSOR in SQL, then it would seem
that only one DECLARE can exist at any time with a given name.
> 14.1 SR 1a) states this for a DECLARE in a SQL client module, but seems to be silent
as to what is required when the declare is not a a module definition.
> Though the SQL OPEN call must go against a single DECLARE.
> The javadoc for Statement.setCursorName says the cursor name must be unique within the
> Derby does detect duplicate names for open cursors (ResultSets) within a connection.
> Existing application impact is a program is using duplicate names for different open
statement objects will hit exceptions if this is fixed.

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

View raw message