Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 70598 invoked from network); 9 Oct 2005 14:18:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 9 Oct 2005 14:18:46 -0000 Received: (qmail 9799 invoked by uid 500); 9 Oct 2005 14:18:45 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 9772 invoked by uid 500); 9 Oct 2005 14:18:44 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Development" Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 9761 invoked by uid 99); 9 Oct 2005 14:18:44 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Oct 2005 07:18:44 -0700 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=HTML_20_30,HTML_MESSAGE,HTML_TITLE_EMPTY X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [192.18.98.36] (HELO brmea-mail-4.sun.com) (192.18.98.36) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Oct 2005 07:18:46 -0700 Received: from phys-bur-1 ([129.148.9.72]) by brmea-mail-4.sun.com (8.12.10/8.12.9) with ESMTP id j99EIMvD001206 for ; Sun, 9 Oct 2005 08:18:22 -0600 (MDT) Received: from conversion-daemon.bur-mail1.east.sun.com by bur-mail1.east.sun.com (iPlanet Messaging Server 5.2 HotFix 1.24 (built Dec 19 2003)) id <0IO300K01IO38Y@bur-mail1.east.sun.com> (original mail from Lance.Andersen@Sun.COM) for derby-dev@db.apache.org; Sun, 09 Oct 2005 10:18:21 -0400 (EDT) Received: from [127.0.0.1] (vpn-129-150-64-79.East.Sun.COM [129.150.64.79]) by bur-mail1.east.sun.com (iPlanet Messaging Server 5.2 HotFix 1.24 (built Dec 19 2003)) with ESMTPA id <0IO300BLFJQKV8@bur-mail1.east.sun.com> for derby-dev@db.apache.org; Sun, 09 Oct 2005 10:18:21 -0400 (EDT) Date: Sun, 09 Oct 2005 10:18:22 -0400 From: "Lance J. Andersen" Subject: Re: [Fwd: Re: How to run the Apache DB Torque tutorial with Derby] In-reply-to: <4347DD02.3090102@debrunners.com> To: Derby Development Message-id: <434926AE.6080702@sun.com> MIME-version: 1.0 Content-type: multipart/alternative; boundary="Boundary_(ID_E5opJ3jnNUbNPCYS4wNHGQ)" X-Accept-Language: en-us, en User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax) References: <434791E1.5000605@Sourcery.Org> <4347DD02.3090102@debrunners.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. --Boundary_(ID_E5opJ3jnNUbNPCYS4wNHGQ) Content-type: text/plain; charset=us-ascii; format=flowed Content-transfer-encoding: 7BIT i wil look to try and clear this up. This comes like most of the other metadata from ODBC and it is probably tied to what acces the user was granted to the specific column . EDR2 which i am pushing this week to the JCP has many clarifications in the javadocs and spec. Still a long way to go, but the spec is starting to be much clearer. -lance Daniel John Debrunner wrote: >Satheesh Bandaram wrote: > > >>I took a quick look at this bug. It seems to me Derby Client is behaving >>as expected rather than the embedded driver though it doesn't seem like >>it. The query in question gets a ResultSet and its metadata as: >> >> ResultSet rs = s.executeQuery("SELECT id, name FROM >>readonlytest"); >> ResultSetMetaData metaData = rs.getMetaData(); >> if (metaData.isReadOnly(1)) >> System.out.println("ID column is readonly"); >> >>Since a FOR UPDATE clause is not specified, the resultset that is >>returned is *readonly*, which is what Derby client returns for >>metaData.isReadOnly(1). Once a FOR UPDATE clause is added, Derby client >>doesn't report the column as readonly. >> >>The problem is really with the embedded driver... Even when FOR UPDATE >>clause is not specified, current implementation of isReadOnly() still >>returns FALSE, when returning TRUE seems more correct. >> >> > >I would say no, the definition of isReadOnly (from the javadoc) is: > >"Indicates whether the designated column is definitely not writable." > >Since embedded doesn't know, false is the correct answer, true would >imply embedded knew *definitely* it wasn't writeable. > >Though of course, the spec could be cleared up, writable in what sense? >Through a positioned update/dml, through updateable result set, through >any DML statement? I think this method has been there since JDBC 1.1 so >that means it cannot mean just with respect to updateable result sets >since they were added in JDBC 2.0. Which probably means is the column >definitely not writable by any operation. > >Dan. > > > > --Boundary_(ID_E5opJ3jnNUbNPCYS4wNHGQ) Content-type: text/html; charset=us-ascii Content-transfer-encoding: 7BIT i wil look to try and clear this up.  This comes like most of the other metadata from ODBC and it is probably tied to what acces the user was granted to the specific column .  EDR2 which i am pushing this week to the JCP has many clarifications in the javadocs and spec.  Still a long way to go, but the spec is starting to be much clearer.


-lance

Daniel John Debrunner wrote:
Satheesh Bandaram wrote:
  
I took a quick look at this bug. It seems to me Derby Client is behaving
as expected rather than the embedded driver though it doesn't seem like
it. The query in question gets a ResultSet and its metadata as:

           ResultSet rs = s.executeQuery("SELECT id, name FROM
readonlytest");
           ResultSetMetaData metaData = rs.getMetaData();
           if (metaData.isReadOnly(1))
                System.out.println("ID column is readonly");

Since a FOR UPDATE clause is not specified, the resultset that is
returned is *readonly*, which is what Derby client returns for
metaData.isReadOnly(1). Once a FOR UPDATE clause is added, Derby client
doesn't report the column as readonly.

The problem is really with the embedded driver... Even when FOR UPDATE
clause is not specified, current implementation of isReadOnly() still
returns FALSE, when returning TRUE seems more correct.
    

I would say no, the definition of isReadOnly (from the javadoc) is:

"Indicates whether the designated column is definitely not writable."

Since embedded doesn't know, false is the correct answer, true would
imply embedded knew *definitely* it wasn't writeable.

Though of course, the spec could be cleared up, writable in what sense?
Through a positioned update/dml, through updateable result set, through
any DML statement? I think this method has been there since JDBC 1.1 so
that means it cannot mean just with respect to updateable result sets
since they were added in JDBC 2.0. Which probably means is the column
definitely not writable by any operation.

Dan.


  
--Boundary_(ID_E5opJ3jnNUbNPCYS4wNHGQ)--