-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: performance hotspot seen in flushEverythingToExecutions()
PostPosted: Fri Jan 12, 2007 7:21 pm 
Newbie

Joined: Fri Jan 12, 2007 7:13 pm
Posts: 4
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.2.1ga

(NOTE: I don't believe this is a bug or performance problem in Hibernate. Most likely, it's my usage of it).

I'm noticing that Session.flush() takes progressively longer as I add entities to Hibernate's session cache.

What's especially odd is that the most expensive operations are not the ones that cause hits to the database for queries, inserts, or updates. JProfiler shows that most of the time is spent in one method, AbstractFlushingEventListener.flushEverythingToExecutions(). As far as I can tell, this method doesn't cause many trips to the database, and where it does (to get the next sequence number for a surrogate key), the underlying SQL call isn't expensive or frequent.

Are there any ways to cut down the cost of this method?

BTW, I've tried making some of our mapped classes immutable, which makes a small difference in the number of dirty checks, but not a really large difference.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 12, 2007 8:30 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
when processing a lot of objects, you can loop on them and every nth (100) flush() and clear().
Alternatively you cna use the statelessSession()

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.