db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dag H. Wanvik (JIRA)" <derby-...@db.apache.org>
Subject [jira] Updated: (DERBY-1323) Detectability methods rowUpdated, rowInserted, rowDeleted can be called from illegal states in both clients
Date Mon, 15 May 2006 03:10:06 GMT
     [ http://issues.apache.org/jira/browse/DERBY-1323?page=all ]

Dag H. Wanvik updated DERBY-1323:
---------------------------------

    Attachment: DERBY-1323-1.stat
                DERBY-1323-1.diff

This patch adds checks for the cases described below, for both
clients, in the JDBC ResultSet API methods rowUpdated, rowDeleted and
rowInserted.

In all cases, the exception "no current row" (SQLState 24000) is
thrown. A new test has been added to jdbcapi/SURTest.java to exercise
all cases.

The JDBC API and specification does not state explicitly what to do in
these situations, as far as I can see.  For the "forward only" case, a
slight, albeit unlikely regression is introduced. I will back out this
change if people think it is risky. I view it as a correction, though.
This is the reason for the changed master files for
lang/updatableResultSet.java.

Now, the cases:

For result sets of type TYPE_SCROLL_INSENSITIVE and CONCUR_UPDATABLE:
- before positioning
- on insertRow
- on beforeFirst row
- on afterLast row
- after deleteRow, before new positioning

For result sets of type TYPE_FORWARD_ONLY and CONCUR_UPDATABLE:
- before positioning (***)
- on insertRow
- after updateRow, before new positioning (*)
- after deleteRow, before new positioning (**)
- after rs emptied out (***)

Detectability is currently not implemented for "forward only" result
sets and the methods always used to return false, even in the states
indicated. The new checks added by this patch (needed for scrollable
result sets) introduce a slight regression, in that calls may now
throw an exception. Cases (*) and (**) broke the regression test as
mentioned, but I think the use of detection methods in these states is
rather meaningless, since Derby can no longer access a row in these
cases anyway - until a next() is performed. Even less problematic
should be {TYPE_FORWARD_ONLY, CONCUR_READ_ONLY} in the cases (***).

I have run derbyall with no related errors and the patch is ready for
review.

> Detectability methods rowUpdated, rowInserted, rowDeleted can be called from illegal
states in both clients
> -----------------------------------------------------------------------------------------------------------
>
>          Key: DERBY-1323
>          URL: http://issues.apache.org/jira/browse/DERBY-1323
>      Project: Derby
>         Type: Bug

>   Components: JDBC, Network Client
>     Versions: 10.2.0.0
>     Reporter: Dag H. Wanvik
>     Priority: Minor
>      Fix For: 10.2.0.0
>  Attachments: DERBY-1323-1.diff, DERBY-1323-1.stat, Main.java
>
> Please see enclosed repro.
> These detectability methods fail to check that they can be called in
> some states. In the repro, calls are allowed while on insert row and
> when after last row. These should both fail. Both clients have the
> same problem. All three detectability methods have the same problem.
> (repro only shows it for a subset of the cases).

-- 
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


Mime
View raw message