-->
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: Performance of Hibernate\EJB3 with composite primary keys
PostPosted: Tue Jul 15, 2008 10:37 am 
Newbie

Joined: Sat Jul 12, 2008 4:25 am
Posts: 8
Hi,

We are using hibernate\EJB3 with a very complex DB scheme. This scheme contains more than 10 complex (interconnected) entities with composite primary keys (our primary key uses up to 5 columns and since this scheme is in production, changing it is impossible) and in our C++ based application, we can handle this large amount of data (>=20000 entities). We now switched from C++ to Java, followed all recommended tips (we're just reading entities: so we can safely set read only query hint, set flush mode to commit) and the performance loss is more than a factor of 15! So we would like to investigate if others have tried to use composite primary keys and if you were satisfied with the performance. Or if there are ways to improve the performance of hibernate when using composite primary keys.

Best regards,
Matthias


Top
 Profile  
 
 Post subject: Re: Performance of Hibernate\EJB3 with composite primary key
PostPosted: Wed Jul 16, 2008 11:50 am 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
Do you know where most of the time is spent? I wouldn't expect much difference from C++ to Java in such an application, but using hibernate is probably a big difference. I encourage you to profile the application and look at the generated sql statements. You might need to enable some L2 caching, and/or try to lazy fetch some dependent data. In my personal experience hibernate usually performs poorly when it is used with complex database and no proper caching.



Farzad-


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.