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: mapping dates
PostPosted: Sat Aug 27, 2005 8:50 am 
Newbie

Joined: Sat Aug 13, 2005 11:35 am
Posts: 5
I am profiling a new application and find that Hibernate is spending 95% of it's time performing a very simple query, which selects * from a single table based on 3 columns. One of the columns is a date, and Hibernate is spending long time checking for changes to the object, in particular creating Calendar instances.

Is there an optimal way to map dates in Hibernate or mappings to avoid?


Top
 Profile  
 
 Post subject: Re: mapping dates
PostPosted: Sat Aug 27, 2005 4:11 pm 
Newbie

Joined: Sat Aug 27, 2005 3:52 pm
Posts: 1
Aaron wrote:
Hibernate is spending 95% of it's time performing a very simple query, which selects * from a single table based on 3 columns.


Is the problem that the query is slow or Hibernate is running it too often?

I would first run an explain on the sql to verify the execution plan is using an index. Adding an index may dramatically improve your response time.

Once you are sure the sql is running optimally, I would look at why Hibernate is running it.

What in the program is causing Hibernate to run the select?

Could you add a integer column to the table (and use the <version> column mapping) to act as a version number? This would make it much easier for Hibernate to tell if the entity has changed.

Regards.


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.