Thanks for the useful infomation, but how are you inferring those cursor
context attributes from the JDBC ResultSet being read-only?

A Derby forward only ResultSet, is read only but:

  - is not scrollable
  - does not have an order by clause

So it fails on two of the context items that make the SQL statement
implicitly read only. It then comes down to is it insensitive? I always
need to go to the JDBC tutorial book to clarify what insensitive means
in this context and I don't have it with me until tomorrow. Though I did
discover a post by Mamta that states Derby's forward only ResultSets are
sensitive:
One thing to keep in mind, while the tutorial is useful, it should not be used as the definitive answer, that needs to be the spec and the javadocs, which is part of the spec.

We have clarified and correct items in the spec which were incorrect in the tutorial. TYPE_FORWARD_ONLY ResultSets, the rows contained depend on how the driver and db materialize the rows. Some drivers might materialize all the rows once the query is executed, others will only be when the row is retrieved.

http://mail-archives.apache.org/mod_mbox/db-derby-dev/200501.mbox/[EMAIL 
PROTECTED]

Another way of looking at it is, what you are saying that with a
statement like SELECT * FROM T, I can only perform a positioned update
on it if:

  - I make the JBDC ResultSet updateable

  - or I add a FOR UPDATE clause to the SQL statement.

Now the FOR UPDATE clause is obvious, but I can't see the link to the
JDBC ResultSet being updateable. I can't see other databases having this
requirement, especially as they supported positioned updates with
read-only ResultSets before JDBC supported updateable ResultSets. I can
see other databases being as restrictive as Derby, hence requiring the
FOR UPDATE, but the old comment did indicate that was against the SQL
standard.


The patch can probably proceed without this being resolved, but it would
be good to come to clear agreement on if SELECT * FROM T can be updated
with a positioned update/delete and a read-only ResultSet. (Even if
Derby doesn't support it today, it would be nice to know or not if it is
meant to be supported).

Dan.

Reply via email to