-->
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.  [ 3 posts ] 
Author Message
 Post subject: performace about jdbc and hibernate and jdbc from hibernate
PostPosted: Thu Nov 27, 2003 9:22 pm 
Beginner
Beginner

Joined: Sat Nov 01, 2003 6:14 am
Posts: 30
hi , guys

i used a hql to execute in hibernate

Code:
from Post as post inner join post.postContent inner join post.poster where post.thread.threadID = :threadid order by post.postTime


it took 170 milliseconds

it's too slow to my opinion , so i want to find out for why

i got the sql from this hql , it is:

[code]
select post0_.postID as postID0_, postcont1_.postContentID as postContentID1_, simplefo2_.forumUserID as forumUserID2_, simpleus3_.userID as userID3_, post0_.postTime as postTime0_, post0_.enableFNCode as enableFN3_0_, post0_.enableHtml as enableHtml0_, post0_.enableSignature as enableSi5_0_, post0_.enableSmile as enableSm6_0_, post0_.visuable as visuable0_, post0_.iconID as iconID0_, post0_.threadID as threadID0_, post0_.posterID as posterID0_, post0_.attachFile as attachFile0_, post0_.emailNotice as emailNo12_0_, post0_.enableImg as enableImg0_, postcont1_.subject as subject1_, postcont1_.ip as ip1_, postcont1_.notes as notes1_, postcont1_.content as content1_, simplefo2_.userID as userID2_, simplefo2_.signature as signature2_, simplefo2_.postCount as postCount2_, simplefo2_.title as title2_, simplefo2_.faceID as faceID2_, simpleus3_.userName as userName3_, simpleus3_.registerDate as register3_3_, simpleus3_.location as location3_, simpleus3_.passWord as passWord3_ from Post post0_ inner join PostContent postcont1_ on post0_.postID=postcont1_.postContentID inner join ForumUser simplefo2_ on post0_.posterID=simplefo2_.forumUserID inner join UserInfo simpleus3_ on simplefo2_.userID=simpleus3_.userID where (post0_.threadID=? ) order by post0_.postTime asc limit 0 , 15
[code]

and then i use jdbc directly , like this:

[code]
ps = conn.prepareStatement(LOAD_PROPERTIES);
ps.setInt(1 , 10000);
java.sql.ResultSet rs = ps.executeQuery();
[code]

it only took 70 milliseconds

i don't belive hibernate is so slow

so i change the code to:

[code]
java.sql.Connection conn = session.connection()[color];
PreparedStatement ps = conn.prepareStatement(sql);
ps.setInt(1 , threadID);
ps.execute();
[/code]

[color=red]still 170 milliseconds


i can't understand what's different between thme at all

who can tell me why???

thanks for your attention.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 28, 2003 6:59 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Are you *sure* you're using the same jdbc parameters ?
Do you use hibernate own collection pooling ? Then don't this must not be used in production environment.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 28, 2003 10:16 pm 
Beginner
Beginner

Joined: Sat Nov 01, 2003 6:14 am
Posts: 30
thanks

and i will try it in weblogic


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.