-->
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.  [ 4 posts ] 
Author Message
 Post subject: Using Hibernate with only one connection
PostPosted: Wed Sep 24, 2003 12:32 pm 
Expert
Expert

Joined: Thu Sep 04, 2003 8:23 am
Posts: 368
Hi,

I am trying to use Hibernate in my application with a MS SqlServer database. I found the jsql driver that rocks.
My question is : can I use the standard edition with Hibernate ? The main restriction of this version is that it just have one connection. Is there some cases where Hibernate need 2 connections at the same time ?

Thanks

Seb


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 25, 2003 7:51 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Connection pools are used thus there is usually a way to configure the min and max size of the pool. In your case you need a min or 1 and a max of 1. Will it work - yes but your stuck if you get a hibernate request that turns out to be concurrent with an existing active access to the data source.

Check the docs for the appraoch you have chosen for setting up the datrasource for configuring the pool size.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 26, 2003 3:20 am 
Expert
Expert

Joined: Thu Sep 04, 2003 8:23 am
Posts: 368
I know how to limit the number of connections with the pool size and I do that. The limit of the pool size do not really care me because there isn't a lot of concurrent users in my app.
My main question is : is there a use case where Hibernate will need more than one connection to retrieve objects for one user ?
Please can you explain me what you mean when you say "your stuck if you get a hibernate request that turns out to be concurrent with an existing active access to the data source". What is the use case you are thinking about ?

Seb


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 26, 2003 3:56 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Hibernate will use the currently associated connection as controlled by your current session object. It will not hold two connections open with the one session. If you have no chance of concurrent access then you will be fine (even though I am not sure why having a small pool matters much). My second comment was concerned with the behaviour of the application/connection pool manager when the connections have run out. The manager may block, may throw an acception or use wait with timeout.


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