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 97739 - Improve speed for "Create Entity class from database"
Summary: Improve speed for "Create Entity class from database"
Status: VERIFIED WONTFIX
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker with 4 votes (vote)
Assignee: Sergey Petrov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-13 14:28 UTC by tomzi
Modified: 2017-01-18 07:19 UTC (History)
3 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tomzi 2007-03-13 14:28:39 UTC
When I create a web application and want to create a entity class from database
Netbeans tries to read all the tables from the database. Exactly this tasks
takes for ever. It took about 20mintues to load 130 tables. 

When I do the same with the database explorer it just pops up in a matter of
milliseconds.

I think it is not necessary to load the whole schema, since I only wanted to
create one table anyway. I think it would be much more efficient to only load
table names first and then load more information depending how many tables I
selected.
Comment 1 Andrei Badea 2007-03-22 14:40:34 UTC
The tables are read in order to allow adding related tables. When you have a
table A with a foreign key on table B and in the wizard you add table A, table B
is added as well. This would not be possible if only table names were read.

That said, I've heard several similar complains, so I guess we should try to
address this case -- probably by allowing the user to select if everything about
the tables should be read, or just their names. The latter would disable the Add
Related Tables checkbox.
Comment 2 tomzi 2007-03-23 13:34:18 UTC
How about if you'd only read the table names in a frist step. The user could
then add those tables. Then I could check 'add related tables'. Now in the next
step FK's from the selected tables are loaded and FK tables would be shown
additionally to the other tables and i could remove the FK tables if i wanted to. 

This would greatly improve speed if I only wanted to add 2 or 3 tables (with or
without FK tables). I guess this is the usual way to add entity classes in a
'grown' project anyway.
Comment 3 Andrei Badea 2008-04-02 12:48:09 UTC
See also issue 130854.
Comment 4 Dongmei Cao 2008-07-07 22:11:27 UTC
Talked with David on this bug. He said the bottleneck is from generating the db schema file. In the future, we should
switch to use metadata.
Comment 5 Jayashri Visvanathan 2008-07-07 22:18:55 UTC
If this is purely a db issue, then we should reassign the bug to db module

Comment 6 Andrei Badea 2008-07-08 10:34:47 UTC
It is not a purely db issue. The wizard could e.g. decide to read table names first, as suggested in desc3. Or it could
allow to disable the "related tables" feature, as in desc2.

Also, I doubt the metadata model would read the whole database schema significantly faster than dbschema.
Comment 7 Andrei Badea 2008-08-06 10:42:17 UTC
*** Issue 138726 has been marked as a duplicate of this issue. ***
Comment 8 Dongmei Cao 2008-11-18 00:21:18 UTC
Also look at issue 76723
Comment 9 Sergey Petrov 2009-07-30 08:51:32 UTC
there are another possible reasons to read schema instead of names, if table have no primary key we can't generate
entities and it currently clock creation on first step.
also see issue 168637, it may be good to check if all columns have defined types.
Comment 10 Sergey Petrov 2011-03-22 14:23:59 UTC
It looks more like enhancement request, also there are a lot of reasons to load full schema, may be something can be improved.
Comment 11 pmb2300 2013-03-19 22:00:41 UTC
What is the status on this? I posted a question today...
http://netbeans.org/bugzilla/show_bug.cgi?id=227678

I'm stuck until I figure this out...
thx
Comment 12 Sergey Petrov 2013-03-20 03:20:19 UTC
hang is completely another issue.
but if you are not happy with performance to retrieve full schema also you can propose something under this issue also, if wizard should allow to filter result (i.e. get data for soem known tables or other  options, may be discussed above)
Comment 13 Martin Balin 2016-07-07 08:56:00 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss
Comment 14 vasster 2016-09-04 13:28:49 UTC
Yes it still exists in nightly-201609040002. Very slow retrieving of lots of tables. It seems that it may take half an hour to retrieve 3000 tables on an Oracle schema (jdbc7 driver).

I don't think it is actually a bug (it's not broken) but an enhancement request.
The past ideas are good candidates. Let it retrieve just the list of table names on schema to show and do actions on the next steps of the wizard for tables that are selected by the user.