This content has been marked as final.
Show 1 reply
-
1. Re: Hibernate loads all entities on manager.merge()
murtuza52 Dec 24, 2006 2:41 AM (in response to murtuza52)I found the culprit. For those who have performance related issue, this might be one of the reasons. The culprit here was the use of FetchType.EAGER. This might be because of "load-before-update" strategy hibernate uses to check the columns have changed. Over use of EAGER means its going to load every related entities in memory and therefore performance is effected.
Make all relations LAZY except for those that are absolutely required. You can easily debug and find out if the application server is working hard to synchronize with the database by using Use tags<property name="hibernate.show_sql" value="true"/> <property name="hibernate.use_sql_comments" value="true"/>
in persistence.xml file. This will show you what is happening in background and you can find out what entities get loaded will persisting or merging.
I hope hibernate or jboss comes up with better strategy to synchronize the data. This doesn't seems to be effecting the performance with server like GlassFish or JDO framework. They have different algorithm that performans more efficients.
Feedback are welcomed to improve the performance further.
Murtuza