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.
Summary: | Slow initialization of the list of entities in REST from Entity wizard | ||
---|---|---|---|
Product: | webservices | Reporter: | Petr Jiricka <pjiricka> |
Component: | REST | Assignee: | Denis Anisimov <ads> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | davidwburns, sj-nb |
Priority: | P3 | Keywords: | PERFORMANCE, PLAN |
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
Petr Jiricka
2009-09-24 15:31:05 UTC
The second panel from the wizard should be replaced by PersistenceClientEntitySelection from Java Persistence API support. The same panel which is used in "JSF Pages from Entity Classes" wizard. *** Bug 132796 has been marked as a duplicate of this bug. *** It is too risky to fix this at the upcoming release . Needs to be fixed in the next release. This is definitely not for 7.0 release. The problem is more deeply than just reusage of existing persistence functionality . Wizards "JPA Controller Classes from Entity Classes" and "Sessions Beans For Entity Classes" uses org.netbeans.modules.j2ee.persistence.wizard.EntityClosure class which provides ONLY entity classes defined inside project folder. On the contrary "RESTful WS from Entity Classes" wizard cares also about entity classes in the binary classpath ( which defined in the jar files on classpath ). This is exactly the reason of slow entities list initialization. I don't know whether we need to care in this wizard about such entities. There is no way to improve performance if we really need to care about "runtime" entities . The only thing that can be improved here : currently "runtime" entities retrieval is badly implemented . Full scan of binary classpath is started each time when wizard is open . Such scan is not needed when wizard is invoked twice. This can be improved. Any following invocation of wizard will work quickly. Only first time will be time consuming. So there are two questions : - Do we really need to care about "runtime" entities in the binary classpath at the wizard - Wizard panels can be reused in case of ignoring of "runtime" entities. If we still need to care about them then probably current panel should be kept. It cannot be reused from j2ee.persistence module. In the latter case only "runtime" entities initialization should be improved. OK, I think I have found the way how it can be done in more convenient way: - one need to refactor and adopt wizard panel which is used f.e. for "Persistence / JPA Controller Classes from Entity " . It's current implementation works only with entities which are defined in the project sources group ( ignore entities defined in the project jar files ). This panel should allows to add additional entities via public methods. So the algorithm for entities search should be : current algorithm for entities defined in the project sources and additionally entities that could be added externally. - existed panel should be also adopted for some UI changes. F.e. RESTful from entities requires to handle referenced entities . So the checkbox in the existed persistence panel should be either non visible or disabled. - changes described above will allow to add additional entities from the usage code. F.e. in the case of RESTful from entities one will be able to add entities from runtime jar files : add "Retrieving..." list item instead of real entities while search is performed. Remove this item from the list and replace it by found entities when they are identified. The behavior is like current except type of entities which requires a time consuming search: entities which are defined in the project source root will be shown very quickly ( immediately ) when wizard panel is shown. And only additional entities will be shown ( if any ) after some time. In most cases user don't want runtime entities . So there is no need to wait until additional entities will be found. So the navigation through the wizard could be done without any pause. - last thing which should be also done for improving functionality : I have already mentioned that currently search of runtime entities badly designed. Each time this search starts from the scratch . This can be optimized by caching entities which have been found at first time . One need to care only about changes in the binary classpath ( listen jar additions/ deletions ). All this changes will improve the wizard and covers all any possible requirements. But such improvement requires a huge number of changes in two different modules. So it is really risky to do it for the 7.0 release. Should be done for Next release. web-main#0c706d06f918 Integrated into 'main-golden', will be available in build *201109060600* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/0c706d06f918 User: Denis Anisimov <ads@netbeans.org> Log: Fix for BZ#173038 - Slow initialization of the list of entities in REST from Entity wizard |