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.  [ 7 posts ] 
Author Message
 Post subject: hibernate.properties file
PostPosted: Wed Dec 03, 2003 12:44 pm 
Newbie

Joined: Wed Nov 19, 2003 7:53 am
Posts: 6
Location: London
Is this file an option?

If I setup my webserver to handle the connection pooling, I can do away with the hibernate properties file right?


Top
 Profile  
 
 Post subject: Sort of.
PostPosted: Wed Dec 03, 2003 1:55 pm 
Senior
Senior

Joined: Sun Aug 31, 2003 3:14 pm
Posts: 151
Location: Earth (at the moment)
The .properties file is optional to an extent, you have to configure Hibernate but you can do it programmatically so you don't actually need an external config file.
However, this is a general thing as opposed to being isolated to connection pooling.
In your case you would still need to turn off Hibernate's connection pooling whether that be programmatically or via the properties file et. al.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 03, 2003 2:07 pm 
Newbie

Joined: Wed Nov 19, 2003 7:53 am
Posts: 6
Location: London
How do I turn off Hibernates connection pooling?

If I use configure the webserver to pool conn's, then pass that connection to open a session, will it not then ignore hibernates settings?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 03, 2003 2:13 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
You can let Hibernate retrieve the connection from the Webserver Pool via JNDI - please read the Documentation


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 03, 2003 2:22 pm 
Senior
Senior

Joined: Sun Aug 31, 2003 3:14 pm
Posts: 151
Location: Earth (at the moment)
http://www.hibernate.org/hib_docs/reference/html/session-configuration.html

for the connection pool property explicitly:
Code:
Configuration configuration = new Configuration();
configuration.setProperty(Environment.POOL_SIZE, "0");


Take a look in the code to see what the defaults for all the various properties are to see which ones you may want, or need, to set to something different.

To have Hibernate get the connection from your container you will also need to set the JNDI properties etc.[/code]


Top
 Profile  
 
 Post subject: pool size and jndi/datasources
PostPosted: Fri Jan 23, 2004 6:14 am 
Beginner
Beginner

Joined: Tue Sep 16, 2003 11:26 am
Posts: 25
Location: Berlin - Germany
hello,

when i retrieve datasources by jndi do i have to set the pool size to 0?

if i set pool size to 0 does hibernate get every new connection by jndi without reusing it?

this is important for me because if dont want hibernate connection pooling for our application. pooling is done by jboss.

thanks for replies, daniel.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 23, 2004 6:40 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
If you use a JNDI Datasource Hibernate does not do pooling itself. Just do not set any pool parameters in the config.


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