-
Dec 2nd, 2011, 04:42 AM
#1
Roo app with Hibernate and Oracle is very slow
Hi,
I'm using Spring Roo with Hibernate and Oracle database and I have a lot of performance issues.
Very often simple insert in the simple table (6 columns) can take up to 15 seconds to process by server.
Loading 2000 records by JSON is also very slow (up to 20 seconds)
I've read something about connection pooling, but since all that configuration is Roo generated, I'm not sure what to search for...
http://forum.springsource.org/showth...formance-issue
What are the guidelines and best practices to profile and speedup my app?
-
Dec 2nd, 2011, 06:39 AM
#2
By inspecting log files, it seems that almost whole database is loaded when saving one entity
I thought that roo and hibernate are lazy loading entities by default
any ideas? tips? hints?
-
Dec 2nd, 2011, 07:45 AM
#3
I've just realized this is probably the cause
https://jira.springsource.org/browse/ROO-2943
However, if have any tips regarding performance optimisation, I'm listening...
-
Dec 3rd, 2011, 06:22 AM
#4
Check @ModelAttribute methods
If you're using Spring MVC as web layer and your entities have relations between them, maybe a good point to check are the ModelAttribute annotated metods.
Look at *Controller_Roo_Controller.aj files. There, you could find some methods annotated with @ModelAttribute. This methods loads several collections of entities related with the entity exposed by the Controller. These collections are used in order to compose input selects in the views. And the bad new is that these methods are invoked with each request to the Controller.
If this is your case, you should customize these methods, push-in to the Controller Java class, changing them in order to load nothing (just a dummy return null). If you need this rellations loaded for compose the view, load them in the methods that you really need them, usually update*/create*. And if your tables have lots of records, maybe the best option is to load them in a paginated way or with a sort of filtering.
I think that all the Web layer technologies supported in Roo (GWT, JSF, Vaadin) loads these Collections in a similar way. If you use other than Spring MVC, try to improve these kind of loads.
Hope this can help you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules