-->
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.  [ 1 post ] 
Author Message
 Post subject: Help: Hibernate 2.1.7 performance issue
PostPosted: Wed Aug 09, 2006 5:21 pm 
Newbie

Joined: Wed Aug 09, 2006 5:19 pm
Posts: 2
I run into a strange Hibernate performance issue these days. Hopefully someone can give me some advice.

I defined two class mappings and use the following code to load them from database:

hsql = "select r,c from "
+ RepActivityRuntime.class.getName()
+ " r,"
+ RepActExecTimeConfig.class.getName()
+ " c "
+ "where r.flowId in (:flowids) and c.id=r.id and r.state not in (:states)";

Query q = session.createQuery(hql.toString());
q.setParameterList("flowids", flowIds);
q.setParameterList("statess", excludeStates);
long starttime = System.currentTimeMillis();
List queryResult = q.list();
System.out.println("Query time:"+(System.currentTimeMillis()-starttime));

The q.list() method returns about 900 records, but it took 11.246 seconds!
I tried to run same SQL against the SQL Serevr database, the result returns in less than a second.


The first class has about 20 fields and the second has about 10. The size of all 900 returned records takes about 1M bytes(I know it becase I copyed query result from Query Analyser and saved to a text file).

We are using Hibenrate 2.1.7.

I heard Hibernate will bring maximum 10% lose of performance. But to me, it is more than 10 times.

Anyone can give me any suggestion about where to look at?

Thanks!

-Li


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

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.