-->
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: Connection handling
PostPosted: Tue Apr 13, 2004 8:50 am 
Newbie

Joined: Tue Apr 13, 2004 6:41 am
Posts: 19
Is it true that hibernate (2.1.2) uses 1 connection per Session and never releases it even if it does not need it. Would not it be much more efficient to request/release connection on-demand - when it is needed for DB access?

Otherwise it is problem for long running transactions.

For example:

1. I am loading Person data in session1 (connection gets associated with session1)
2. Person data is displayed in webform, where user modifies it and sends back to server.
3. I am starting transaction for session1, populating data and doing session1.update(person1). and doing commit for that transaction
4. closing session1 (connection gets released)

once number of users who have opened this form or any other form for update will exceed number of connections allowed I will start geting Exceptions.

Also I can not really load data in one Session and save it in another, because objects graphs are pretty complex and I would like to track changes and save only changed objects (using cascade).

What are your suggestions folks?

Rihards


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 13, 2004 8:52 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Session.disconnect()


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 13, 2004 9:16 am 
Newbie

Joined: Tue Apr 13, 2004 6:41 am
Posts: 19
Thanks


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.