-->
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: Session performance
PostPosted: Thu Apr 03, 2008 8:04 am 
Newbie

Joined: Thu Apr 03, 2008 7:47 am
Posts: 2
Hello fellow Hibernate Users!

Im currently in the process of rewriting an application using Spring(2.x) and Hibernate(3.x). as it is now i have a lot of DAO classes and some Service classes using the DAO's.
All DAO classes are using the HibernateDAOSuport class.

In this application performance is a great issue, and it is simply not possible to open a new session eveytime a DAO method is invoked.
At the same time there are currently no transaction management as well, as we fear this might criple our performance further.

My Question is this:
When, and how do i manage the opening and closing of Sessions in order to open as few as possible?
I have considered allowing a lot of the find queries to use the same session, but im unsure as how this would be implemented, and if this is a good way to do things.
i have also considered lettign the Service classes open the sessiones and pass them on to the DAO classes whenever such is used.

Hope someone can help me out.

Best regards.
MadsJac


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 03, 2008 8:58 am 
Beginner
Beginner

Joined: Fri Jun 25, 2004 11:47 am
Posts: 34
hi,

I think, what you are talking about is the hibernate SessionFactory and not the session.
Getting an hibernate session should not exceed some millisecond. Building the SessionFactory is one time process when your Application is started.

There are many way to handle life cycle of a session and quite a lot of documentation (on my side, opening/closing session is delegated to JTA). If you keep your session open for a long time/man requests without cleaning it, you might have memory and performance problems.

Rgds,


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 03, 2008 9:26 am 
Newbie

Joined: Thu Apr 03, 2008 7:47 am
Posts: 2
The SessionFactory is injeted on load time, so it should't be a problem.
I know we are talking details here, but on peaks the system has to be able to handle about 500 executions/min and each execution requires about 50 database calls.
Thats a lot of session, and it would be nice to save some of them as performance is a real issue here


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.