[jboss-user] [EJB 3.0] - Re: flushing EJB3 for use with EJB2.1

robert.geisler do-not-reply at jboss.com
Mon Jun 29 10:21:35 EDT 2009


some update here...

we are almost done with our ejb2.1-to-ejb3.0-migration. but some weeks ago we have been in deep doo-doo(?). the problem was the performance of the ejb3 entity manager when it came to persist, update and remove very, very much entities in one long transaction (long >= 2 minutes).
we tried to log and debug the data layer and finally recognized, that performance of calling entity manager's cud methods (create, update, delete) slows down more and more the longer the transaction is running.

our sample transaction took about 8 minutes before ejb 3.0. after migration, it always met the transaction timeout (>= 30 minutes (for testing)!!) and we had no idea what could be the reason. question: Hibernate? well, we tried another persistence provider (thanks JBoss for easy changing the persistence provider! :) *noirony*), EclipseLink, and got it done in about 10 minutes. answer: Hibernate!?

kind of strange behaviour, we thought, but we were able to find a solution: we now dont call flush after single cud methods, but call flush and clear on entity manager just before our data layer returns. that improved our performance extremly; after applying the new pattern, our sample transaction took about 2 minutes (Hibernate! EclipseLink now needs about 22 minutes ;)).

so far...
i hope, our experiments and experience may help others, too.
regards
robert

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4240770#4240770

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4240770



More information about the jboss-user mailing list