Bug 66471 - [cat50] "Unable to read the database structure, connection is broken;" exception when a table node is expanded
[cat50] "Unable to read the database structure, connection is broken;" except...
Status: RESOLVED DUPLICATE of bug 111055
Product: db
Classification: Unclassified
Component: Code
5.x
All All
: P3 with 5 votes (vote)
: 6.x
Assigned To: David Vancouvering
issues@db
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-10-11 13:08 UTC by Andrei Badea
Modified: 2008-10-09 18:55 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrei Badea 2005-10-11 13:08:34 UTC
From an user report: 

Either attempting to "open" a table or right-clicking on the table causes:
"Unable to read the database structure, connection is broken; ORA-01031 error:
insufficient privileges)". This issue is not present on NetBeans 4.1.

I loaded today's [20051010 daily build] development release.  When I attempt to
open a table I get the error described in the prior e-mail.  The error is being
caused by the call:

ANALYZE TABLE <blah> ESTIMATE STATISTICS

On 4.1 we instead see:

SELECT NULL AS table_cat, t.owner AS table_schem,
t.table_name AS table_name, t.column_name AS column_name,
DECODE (t.data_type,
'CHAR', 1,
'VARCHAR2', 12,
'NUMBER', 3,
'LONG', -1,
'DATE', 93,
'RAW', -3,
'LONG RAW', -4,
1111
) AS data_type,
t.data_type AS type_name,
DECODE (t.data_precision,
NULL, t.data_length,
t.data_precision
) AS column_size,
0 AS buffer_length, t.data_scale AS decimal_digits,
10 AS num_prec_radix, DECODE (t.nullable, 'N', 0, 1) AS nullable,
NULL AS remarks, t.data_default AS column_def, 0 AS sql_data_type,
0 AS sql_datetime_sub, t.data_length AS char_octet_length,
t.column_id AS ordinal_position,
DECODE (t.nullable, 'N', 'NO', 'YES') AS is_nullable
FROM all_tab_columns t
WHERE t.owner LIKE :1 ESCAPE '/'
AND t.table_name LIKE :2 ESCAPE '/'
AND t.column_name LIKE :3 ESCAPE '/'
ORDER BY table_schem, table_name, ordinal_position

And this works with no problems.
Comment 1 Andrei Badea 2005-12-09 16:54:48 UTC
The "problem" is caused by the fix of issue 55410. SQLException-s thrown while
retrieving the database metadata are thrown instead of being silently logged. 

In this particular case the exception is caused by a
DatabaseMetaData.getIndexInfo() call on the Oracle driver. The driver tries to
analyze the table for retrieving the index info, and the user probably doesn't
have enough rights for this operation.

Both I and QE consider that notifying exceptions is a better behavior. Hiding
them and pretending everything went right could result in displaying incomplete
metadata without giving a clue that they are incomplete.
Comment 2 gholmer 2005-12-12 14:22:40 UTC
I get the same error against an IBM iSeries ("AS/400"), error message ends 
with "[SQL0901] SQL system error". 
 
Comment 3 clever 2005-12-12 15:22:29 UTC
So THIS is whats going on!  I've seen this on occasion... always seems to work
the second time around. Gets my vote!
(And why was it closed?? Thats not clear in the description)
Comment 4 Andrei Badea 2005-12-12 16:24:37 UTC
To gholmer and clever: sorry, but I need more details, such as the database
server and driver, as well as what exactly you were doing at the time the error
occured. Marking as incomplete for now.

I have never seen this issue on our testing databases, and the reason why some
people get the error on 5.0, although they did not get it on 4.1 is that now the
exceptions are reported instead of being silently logged to the message log. The
issue is closed because the error in the issue's description is not caused by
NetBeans, but by the database settings or buggy driver.

I will attach a program which makes the same calls that Database Explorer makes
and I will ask you to test it against your databases and see if you get the same
error.
Comment 5 Petr Blaha 2006-03-13 13:32:20 UTC
TM 5.0 -> TBD
Comment 6 gholmer 2006-03-13 14:54:11 UTC
Steps to reproduce: 
 
1) In Runtime tab, expand Databases node. Right-click "Drivers" and select 
"Add Driver". Select jt400.jar (JTOpen 5.0 version, 
http://jt400.sourceforge.net/). Driver class 
(com.ibm.as400.access.AS400JDBCDriver) is detected correctly. Give connection 
the name "IBM AS/400 Toolbox for Java". 
 
2) Right-click "IBM AS/400 Toolbox for Java" and select "Connect Using...". 
For Database URL, enter "jdbc:as400://<machine name>". Enter a valid user ID 
and password on the AS/400. A list of schemas (AS/400 "libraries") is 
returned. Select any one. 
 
3) Expand the connection icon, then the "Tables" icon. A dialog is opened with 
the text "Unable to read the database structure, connection is broken; 
[SQL0901] SQL system error." The turner on the "Tables" tree node disappears 
when the dialog is dismissed. 
 
Where is the attachment mentioned above? 
 
Comment 7 Andrei Badea 2006-09-08 13:44:37 UTC
There was no time to fix this for 5.5. Hopefully for 6.0.
Comment 8 gholmer 2007-03-06 13:20:42 UTC
Problem with AS/400 was not related to NetBeans, see this URL:

http://www-912.ibm.com/8625680A007CA5C6/1AC66549A21402188625680B0002037E/85E493BAFD4E2B9386256FF500732959

Comment 9 David Vancouvering 2008-01-09 23:44:55 UTC
gholmer, abadea: I can't tell: is this still an issue?  gholmer says the IBM issue was not related to NetBeans, and
that's the only real instructions on how to reproduce I have...  Thanks.
Comment 10 gholmer 2008-01-10 13:54:04 UTC
No longer an issue here.
Comment 11 Andrei Badea 2008-01-10 14:31:00 UTC
If this is not a problem on AS/400 anymore, it is likely a duplicate of issue 111055.
Comment 12 David Vancouvering 2008-10-09 18:55:23 UTC

*** This issue has been marked as a duplicate of 111055 ***


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo