This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Hibernate optimization problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate optimization problem" Watch "Hibernate optimization problem" New topic
Author

Hibernate optimization problem

Elizabath Lima
Ranch Hand

Joined: Nov 23, 2005
Posts: 32
Hi,

I'm developing a web application using spring and hibernate and Mysql. My database contains huge records (more than 2 lacs). Most of the time, for each user, i need to fire a query to select a considerable number of records (say 20 thousand). After fetching the result i need to disply it using pagination. So i don't nedd all the records at the same time, but by clicking on the next page (or a specific page number) link i need to show the respective records.

While executing the query, it takes long time and responds with out of memory error. I tried setting getHibernateTemplate().setFetchSize(200) but the performance is same. I tried different combination of changing the mysql driver, setting hibernate.jdbc.batch_size but all in vain.

How i can resolve this performance issue? wat approach i can follow to solve this? What parameters i need to take care for a large database application like this?
pascal betz
Ranch Hand

Joined: Jun 19, 2001
Posts: 547
Criteria.setFirstResult(), Criteria.setMaxResults()

and not everyone knows what a lac is :-)
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2919
    
    5
Originally posted by pascal betz:
and not everyone knows what a lac is


???


Lac is also a less common way to spell lakh, in the Indian numbering system equivalent to 100,000

http://en.wikipedia.org/wiki/Lac_%28disambiguation%29
pascal betz
Ranch Hand

Joined: Jun 19, 2001
Posts: 547
i learned that when i was in india ....

there is also "crore" which is a 100 * lakh (lac) :-)
 
Consider Paul's rocket mass heater.
 
subject: Hibernate optimization problem
 
Similar Threads
Hibernate slow when pulling a large dataset
Bulk updates vs Sql query to update bulk records in Hibernate
Hibernate & Connection Pooling
Hibernate query returning 0 records
Delay in JDBC ResultSet