This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 106723 - cannot display table structure for "foreign" schema
Summary: cannot display table structure for "foreign" schema
Status: RESOLVED DUPLICATE of bug 88097
Alias: None
Product: db
Classification: Unclassified
Component: Code (show other bugs)
Version: 5.x
Hardware: PC All
: P3 blocker (vote)
Assignee: Andrei Badea
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-14 21:50 UTC by jbarnett
Modified: 2007-07-11 13:40 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jbarnett 2007-06-14 21:50:08 UTC
when multiple schemas are used in an application, the db explorer cannot display table structures of schemas outside the
username used in the database connection url even though the "advanced" "select schmema" is used, and select permissions
are granted (this worked in NB 5.0 and earlier). Tables can be viewed when username==schema.

The database error reported is ora-01031 :insufficient privileges.

Apparently the privilege required is "analyze all", but this is unacceptable, since it is database-wide, and cannot be
granted on a case by case basis.
Comment 1 Andrei Badea 2007-06-19 09:52:31 UTC
The Oracle JDBC driver executes an ANALYZE TABLE statement when the DatabaseMetaData.getIndexInfo() method is called. No
workaround known.


*** This issue has been marked as a duplicate of 88097 ***
Comment 2 Andrei Badea 2007-07-10 12:24:47 UTC
From reporter by private e-mail:

> How about just catching the exception and gracefully leaving out the Index info, but displaying everything else? 

I would prefer not silently swallowing exceptions and pretending that everything worked fine. The exception needs to be
reported, otherwise people will file issues about (in this case) indexes not being displayed.
Comment 3 jbarnett 2007-07-10 21:36:14 UTC
Tracing back the duplicates of my problem report I found:
> Issue 59535
> ------- Additional comments from mschovanek Fri Sep 16 08:35:46 +0000 2005 -------
>
> Additional user information:
> ----------------------------
>
> ....
> I believe the problem is here:
>
> ResultSet rs = dmd.getIndexInfo(drvSpec.getCatalog(), drvSpec.getSchema(),
> table, false, false);
>
> The last parameter is 'approximate' - when true, result is allowed to
> reflect approximate or out of data values; when false, results are requested
> to be accurate
>
> Because the parm is set to false, Oracle (and some other databases, I would
> surmise) runs update statistics to gather the accurate data.  Setting the
> parm to true will cause Oracle to respond with the results from the last run
> of statistics.
> ....
>
> ------- Additional comments from abadea Wed Oct 5 09:12:06 +0000 2005 -------
>
> Fixed by retrieving the indexes using aproximate = true.

Apparently there *was* something that Netbeans was doing that invoked the ANALYSE call by Oracle (approximate=false). 
And *apparently* there was a fix back in 2005.  Is it possible that a recent change reintroduced the bad parameter?
Comment 4 jbarnett 2007-07-10 21:39:57 UTC
I'm also upping the priority based on the same logic as mschovanek.
Comment 5 Andrei Badea 2007-07-11 13:39:59 UTC
> I'm also upping the priority based on the same logic as mschovanek.

Note that mschovanek did not increase the priority, he decreased it:
http://www.netbeans.org/issues/show_activity.cgi?id=59535

> Is it possible that a recent change reintroduced the bad parameter?

No. That call to getIndexInfo() is in the db module in TableNodeInfo and the approximate parameter has been false since
October 2005.


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