X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id CE635DBB51 for ; Fri, 18 Nov 2005 20:35:21 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 12315-10 for ; Sat, 19 Nov 2005 00:35:23 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sapo.pt (relay6.ptmail.sapo.pt [212.55.154.26]) by svr1.postgresql.org (Postfix) with SMTP id ACEB8D82C0 for ; Fri, 18 Nov 2005 20:35:18 -0400 (AST) Received: (qmail 8592 invoked by uid 0); 19 Nov 2005 00:35:17 -0000 Received: from unknown (HELO sapo.pt) (10.134.35.207) by relay6 with SMTP; 19 Nov 2005 00:35:17 -0000 Received: (qmail 30289 invoked from network); 19 Nov 2005 00:35:17 -0000 X-AntiVirus: PTMail-AV 0.3.87.1 X-Virus-Status: Clean (0.01714 seconds) Received: from unknown (HELO [10.0.0.6]) (op217537@[81.193.136.120]) (envelope-sender ) by mta12 (qmail-ldap-1.03) with SMTP for ; 19 Nov 2005 00:35:17 -0000 Subject: Re: Again the JSCreator and Metadata issues From: pedro farinha To: Kris Jurka Cc: "jdbc.postgres" In-Reply-To: References: <1132193745.6622.9.camel@localhost.localdomain> Content-Type: multipart/alternative; boundary="=-C2UbamHX6uL0Dy8B4a3p" Message-Id: <1132360517.3913.38.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Sat, 19 Nov 2005 00:35:17 +0000 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.426 required=5 tests=[AWL=0.480, HTML_10_20=0.945, HTML_MESSAGE=0.001] X-Spam-Score: 1.426 X-Spam-Level: * X-Archive-Number: 200511/121 X-Sequence-Number: 14219 --=-C2UbamHX6uL0Dy8B4a3p Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi Kris, I have made a new post into the creator Feedback program, referring you're assumptions and solutions. Lets see if we can get any news from them before doing the changes, if any. I haven't tried it yet but I will try to verify that the problem is really related with "variable size fields". If it is we can always say "in order to use creator you must not use variable size fields". I will try to test with a table with all fields with fixed size, then with fields with variable size and see what I'll hit. On my post to the feedback program I raised the question of int.MAX_VALUE and what would be the impact of it. I also suggested a "default value" which while not correct may not impact much into the real implementation and also the magic number "0". What does it mean when you have a column with size = 0? . As you can see I am not very familiar with DB structures at all, thus the probably stupid question, what is the size of a "blob" column ? can it be fixed?. thanks for you're help. On Fri, 2005-11-18 at 18:41, Kris Jurka wrote: > On Thu, 17 Nov 2005, pedro farinha wrote: > > > I am testing the new JSC2 early access and I come across a old > > problem....getResultMetaData null values (I think). In JSC 1 the driver > > works fine but on this early access version it doesn't. I am posting > > what I think is relevant of the trace. I am not sure if this is a issue > > with the driver or the JSC it self so I am posting this into here as > > well as into the EAfeedback program. > > > > java.lang.RuntimeException: java.sql.SQLException: Invalid column > > display size. Cannot be less than zero > > at > > com.sun.data.provider.impl.CachedRowSetDataProvider.getMetaData(CachedRowSetDataProvider.java:1299) > > I believe you have a variable length field in your table. Sun's > CachedRowSet implementation examines the ResultSetMetaData and creates its > own copy of it. The postgresql JDBC driver returns -1 for > ResultSetMetaData.getColumnDisplaySize() meaning unknown for variable > length fields, like say a column of type "text". Sun does not like this > value and reports an error. In the past we've tried to ask Sun for some > advice in this area and got nothing in response. Other than -1 the > only other real defensible value for getColumnDisplaySize would > probably be Integer.MAX_VALUE. We've been concerned that GUIs would > try to actually use this provided value and they would blow up, but > the only complaints we've heard are from people disliking the -1 > value and this problem doesn't seem to be going away. > > I suggest we try returning Integer.MAX_VALUE for a while and see what > complaints we get. Objections? > > Kris Jurka > > ---------------------------(end of broadcast)--------------------------- > TIP 5: don't forget to increase your free space map settings --=-C2UbamHX6uL0Dy8B4a3p Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit Hi Kris,
I have made a new post into the creator Feedback program, referring you're assumptions and solutions. Lets see if we can get any news from them before doing the changes, if any.
I haven't tried it yet but I will try to verify that the problem is really related with "variable size fields". If it is we can always say "in order to use creator you must not use variable size fields".
I will try to test with a table with all fields with fixed size, then with fields with variable size and see what I'll hit.
On my post to the feedback program I raised the question of int.MAX_VALUE and what would be the impact of it. I also suggested a "default value" which while not correct may not impact much into the real implementation and also the magic number "0". What does it mean when you have a column with size = 0? . As you can see I am not very familiar with DB structures at all, thus the probably stupid question, what is the size of a "blob" column ? can it be fixed?.

thanks for you're help.


On Fri, 2005-11-18 at 18:41, Kris Jurka wrote:
On Thu, 17 Nov 2005, pedro farinha wrote:

> I am testing the new JSC2 early access and I come across a old 
> problem....getResultMetaData null values (I think). In JSC 1 the driver 
> works fine but on this early access version it doesn't. I am posting 
> what I think is relevant of the trace. I am not sure if this is a issue 
> with the driver or the JSC it self so I am posting this into here as 
> well as into the EAfeedback program.
>
> java.lang.RuntimeException: java.sql.SQLException: Invalid column
> display size. Cannot be less than zero
> at
> com.sun.data.provider.impl.CachedRowSetDataProvider.getMetaData(CachedRowSetDataProvider.java:1299)

I believe you have a variable length field in your table.  Sun's 
CachedRowSet implementation examines the ResultSetMetaData and creates its 
own copy of it.  The postgresql JDBC driver returns -1 for 
ResultSetMetaData.getColumnDisplaySize() meaning unknown for variable 
length fields, like say a column of type "text".  Sun does not like this 
value and reports an error.  In the past we've tried to ask Sun for some 
advice in this area and got nothing in response.  Other than -1 the 
only other real defensible value for getColumnDisplaySize would 
probably be Integer.MAX_VALUE.  We've been concerned that GUIs would 
try to actually use this provided value and they would blow up, but 
the only complaints we've heard are from people disliking the -1 
value and this problem doesn't seem to be going away.

I suggest we try returning Integer.MAX_VALUE for a while and see what 
complaints we get.  Objections?

Kris Jurka

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings
--=-C2UbamHX6uL0Dy8B4a3p--