db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bernt M. Johnsen" <Bernt.John...@Sun.COM>
Subject Re: [jira] Commented: (DERBY-690) Add scrollable, updatable, insensitive result sets
Date Wed, 01 Mar 2006 19:08:09 GMT
>>>>>>>>>>>> Daniel John Debrunner wrote (2006-03-01 06:58:39):
> Bernt M. Johnsen wrote:
> 
> 
> > We should also strive to make "insensitivity" as close to the SQL
> > defintion as possible (SQL 2003 p. 96):
> > 
> >    A change to SQL-data is said to be independent of a cursor CR if
> >    and only if it is not made by an <update statement: positioned> or a
> >    <delete statement: positioned> that is positioned on CR.
> > 
> >    A change to SQL-data is said to be significant to CR if and only if
> >    it is independent of CR, and, had it been committed before CR was
> >    opened, would have caused the table associated with the cursor to
> >    be different in any respect.
> > 
> >    A change to SQL-data is said to be visible to CR if and only if it
> >    has an effect on CR by inserting a row in CR, deleting a row from
> >    CR, changing the value of a column of a row of CR, or reordering
> >    the rows of CR.
> > 
> >    [...]
> > 
> >    - If the cursor is insensitive, then significant changes are not visible.
> 
> Does JDBC's definition of INSENSITIVE line up with SQL's?
> 
> JDBC 3.0 (14.1.1) (and JDBC 4.0 16.1.1)
> > The result set is insensitive to changes made to the underlying data source while
> > it is open. It contains the rows that satisfy the query at either the time the query
is
> > executed or as the rows are retrieved.
> 
> SQL seems to say that if an update happens while the cursor is open then
> an insensitive cursor will not see it.
> 
> JDBC says you might see it, due to the "as the rows are retrieved".

I'm afraid you're right. But "might" is not synonymous to "should",
and if the implementation cost and/or performance penalty is not too
high, I would prefer an JDBC implementation in line with the SQL
definition.



-- 
Bernt Marius Johnsen, Database Technology Group, 
Staff Engineer, Technical Lead Derby/Java DB
Sun Microsystems, Trondheim, Norway

Mime
View raw message