db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@debrunners.com>
Subject Re: [jira] Updated: (DERBY-231) "FOR UPDATE" required for updatable result set to work
Date Fri, 04 Nov 2005 18:29:34 GMT
Bernt M. Johnsen wrote:


> Thus when you in JDBC writes
> 
> PreparedStatement p = c.prepareStatement("SELECT * FROM T");
> ResultSet rs = p.executeQuery();
> 
> it is equivalent to
> 
> PreparedStatement p = c.prepareStatement("SELECT * FROM T", 
>                                          ResultSet.TYPE_FORWARD_ONLY,
>                                          ResultSet.CONCUR_READ_ONLY);
> ResultSet rs = p.executeQuery();
> 
> which again should be equivalent something like
> 
> PREPARE p FROM SELECT * FROM T FOR READ ONLY;
> DECLARE rs NO SCROLL CURSOR FOR p;

That's the leap of faith I have trouble with. The assumption that the
read only of the result set means read only status of the SQL query.

I see the ResultSet.CONCUR_READ_ONLY only applying to the client side
ResultSet, because that's what it is declared to mean.

public static final int CONCUR_READ_ONLY

    The constant indicating the concurrency mode for a ResultSet object
that may NOT be updated.

And we have instances where we know the ResultSet being read only does
not make the SQL query read only, when the select includes the FOR UPDATE.

Dan.


Mime
View raw message