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 98320 - Entity Classes from DB: slow validation of the Entity Classes panel
Summary: Entity Classes from DB: slow validation of the Entity Classes panel
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Andrei Badea
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2007-03-20 13:29 UTC by Andrei Badea
Modified: 2007-09-14 14:48 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Unfinished changes improving the performance of PersistenceLibrarySupport (4.93 KB, application/octet-stream)
2007-03-20 14:16 UTC, Andrei Badea
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrei Badea 2007-03-20 13:29:58 UTC
On a web application on Tomcat invoke the Entity Classes from DB wizard, select
a data source, some tables and press Next. In the Package text field enter
"entity". There is a noticeable delay after each key press, which seems caused
by the check for a persistence provider.
Comment 1 Andrei Badea 2007-03-20 14:16:10 UTC
Created attachment 39695 [details]
Unfinished changes improving the performance of PersistenceLibrarySupport
Comment 2 Andrei Badea 2007-03-20 14:22:37 UTC
The attachment (sorry for the application/octet-stream) contains some unfinished
changes to PersistenceLibrarySupport which significantly improve the performance
on my machine. I say unfinished because the other containsPath() and
containsService() methods could probably be improved as well. And since I'm at
it, getFirstProviderLibrary() and getLibrary() could be improved too to.

Reassign to me when done. I'll also modify EntityClasses to cache the result of
PersistenceLibrarySupport.getProvidersFromLibraries().
Comment 3 Erno Mononen 2007-03-20 14:45:27 UTC
Thanks for the patch. If you would happen to have any idea from where the 
methods originally came from (my understanding is that the original versions 
might have been copied from somewhere), it would be nice to improve the 
original code as well. I know that the methods used to reside in 
o.n.m.j2ee.metadata.Utils, but that's about it.
Comment 4 Andrei Badea 2007-03-20 15:15:39 UTC
No idea, today was the first time that I saw these methods.
Comment 5 Erno Mononen 2007-08-14 16:59:43 UTC
I've applied the patch a while ago (apr 18th), other improvements are still pending. Setting the target milestone to 
6.0.
Comment 6 Erno Mononen 2007-09-13 10:19:52 UTC
I made some further optimizations, mainly in the getLibrary method (by avoiding multiple calls to getLibraryClassPath 
and extractProvider). Not sure whether it made much difference though as I didn't make any exact measurements and can't 
tell for sure just by invoking the wizard. Please feel free to optimize to a greater extent if you like.

Checking in PersistenceLibrarySupport.java;
/cvs/j2ee/persistence/src/org/netbeans/modules/j2ee/persistence/wizard/library/PersistenceLibrarySupport.java,v  <--  
PersistenceLibrarySupport.java
new revision: 1.8; previous revision: 1.7
done
Comment 7 Erno Mononen 2007-09-13 10:31:42 UTC
The previous commit removed the sorting from the getProvidersFromLibraries method, added it back:

Checking in PersistenceLibrarySupport.java;
/cvs/j2ee/persistence/src/org/netbeans/modules/j2ee/persistence/wizard/library/PersistenceLibrarySupport.java,v  <--  
PersistenceLibrarySupport.java
new revision: 1.9; previous revision: 1.8
done
Comment 8 Andrei Badea 2007-09-14 14:48:42 UTC
Now also caching the result of PersistenceLibrarySupport.getProvidersFromLibraries() in EntityClassesPanel and closing.

Checking in src/org/netbeans/modules/j2ee/persistence/wizard/fromdb/EntityClassesPanel.java;
/cvs/j2ee/persistence/src/org/netbeans/modules/j2ee/persistence/wizard/fromdb/EntityClassesPanel.java,v  <-- 
EntityClassesPanel.java
new revision: 1.11; previous revision: 1.10
done