-->
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: Complex Big Queries with Hibernate.
PostPosted: Fri Feb 27, 2009 6:52 am 
Newbie

Joined: Fri Feb 27, 2009 6:39 am
Posts: 1
We need to fetch data from Terabase DB with the join of multiple tables. The query uses Subquery inside it to fetch some data for the base query. Its finally a huge query crossing 2 pages. If we execute the same query directly in the DB, its taking some fraction of seconds to produce the reply.
But if we use Hibernate, its taking more time around 5-10 mins or some time it raises memory crashes and session problems. We have proper ORM mapping between the objects and uses JPA for mapping with the tables.
The TeraDB has lakhs of records and have interrelations within the tables.
My question is, is Hibernate the right solution for executing Big and complex queries? Whoever used Hibernate with big queries might have faced this problem. Experts please suggest.

Thanks,


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 27, 2009 9:51 am 
Beginner
Beginner

Joined: Wed Nov 19, 2008 8:25 am
Posts: 46
Location: Saint Petersburg, Russian Federation
Have you profiled your use-case? There is a number of bottleneck reasons, for example:

* network bottleneck because of huge traffic between application and database;
* relational -> object representation processing, i.e. when query results are transformed to the application level objects;

Right approach is:

* compare hibernate-based use-case processing with plain jdbc-based one;
* profile the application in order to find out the real bottleneck;

I.e. you must exactly identify the problem before trying to solve it.


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.