-->
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: Hibernate performance problems in JBoss.
PostPosted: Sat Mar 26, 2005 7:27 am 
Newbie

Joined: Sat Mar 26, 2005 7:14 am
Posts: 3
Hello everyone,

last days I did some tests concerning the performance of Hibernate
within Jboss and "standalone".
I came to some disappointing results
concerning the performance within JBoss (using CMT):


1) The datasource access seems to be significantly slower as with Hibernate "standalone".
In some examples it was three times slower.

2) Moreover I was not able to do caching (using Hasttable, EhCache, as well as JBoss' TreeCache) beyond the scope of a single transaction.
This dramatically decreases the performance.
I mean the following:
When I perform a certain select statement for
the first time within a transaction it takes about 750 msecs,
if i perform it again within the same transaction (i.e., within the
same ejb-method call) it takes 60 msecs.
Now, if perform this transaction (i.e. ejb-method call) again and again,
it always takes the same 750 resp. 60 msecs.
For me it seems that there is no caching beyond transaction scope.
Btw, I encountered no differences when using transactional, read-write,
nonstrict-read-write caching....

Now I wonder about the following:

Did I do something seriously wrong?

Is it not possible to do caching beyond the scope of a single transaction
(which seems to be very unlogical to me)?

Btw, I used a standard hibernate-service.xml.
Moreover, I used postgres and the standard postgres-ds.xml.
(but hsqldb was the same).

Thanks a lot for your help, best wishes and happy eastern

Michael

**************************************************


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 30, 2005 8:32 pm 
Newbie

Joined: Sat Mar 12, 2005 12:01 pm
Posts: 8
It sounds to me like you are only using first level cache. This cache is scoped to the life of your session, and, if I remember correctly, with CMT this is tied to your transaction. This means the inital 750ms is the time it takes to load your object from the database. The subsequent 60ms times are from the first level (Session) cache.

If you want longer term caching, you need to make sure you enable the second level cache.

If you don't already have it, buy the Hibernate In Action book. It covers this very well.


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.