-->
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.  [ 6 posts ] 
Author Message
 Post subject: oracle connection pool
PostPosted: Sun Apr 13, 2008 3:31 pm 
Newbie

Joined: Sun Mar 30, 2008 10:15 pm
Posts: 18
Hello,

I'm using oracle 10g and in my cfg.xml file I haven't set any connection pooling properties.

when I look at the log I see:
INFO [org.hibernate.connection.DriverManagerConnectionProvider] Using Hibernate built-in connection pool (not for production use!)

Few questions:
1. I'm using oracle.jdbc.driver.OracleDriver, do I need to use a connection pooling strategy? Doesn't oracle already have a connection pooling strategy?
2. How can I turn off hibernate's pooling strategy?
3. what config should I use to enable oracle's connection pooling strategy?

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 14, 2008 3:14 pm 
Newbie

Joined: Sun Mar 30, 2008 10:15 pm
Posts: 18
could someone please help me with this. I've googled for it, but haven't found anything.

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 15, 2008 2:25 am 
Beginner
Beginner

Joined: Fri Sep 08, 2006 7:29 am
Posts: 36
Create a datasource and configure it in the hibernate.cfg.xml

_________________
Shardul
Please Rate.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 15, 2008 2:28 am 
Beginner
Beginner

Joined: Fri Sep 08, 2006 7:29 am
Posts: 36
Alternatively you can also use this...



Code:
<property name="connection.provider_class">
         org.hibernate.connection.C3P0ConnectionProvider
      </property>
      <property name="c3p0.min_size">5</property>
      <property name="c3p0.timeout">1000</property>
      <property name="c3p0.max_size">50</property>
      <property name="c3p0.idle_test_period">10000</property>
      


put it in your hibernate.cfg.xml and add the c3p0-0.9.0.jar to your lib. There are other such connection pools available as well.

_________________
Shardul
Please Rate.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 16, 2008 9:33 am 
Newbie

Joined: Sun Mar 30, 2008 10:15 pm
Posts: 18
Thanks for the response, I should have included my cfg in the first place...sorry, please check it out. I'm not defining any connection pool parameter...but hibernate log insists that it is using the default connection pool mechanism. How can I turn it off? How can I use oracles connection pool (if there is such a thing)?

Thanks again for your help!

<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@localhost:1521:xe </property>
<property name="hibernate.connection.username">uid</property>
<property name="hibernate.connection.password">pswd</property>
<property name="hibernate.default_schema">schema</property>
<property name="current_session_context_class">thread</property>

</session-factory>
</hibernate-configuration>


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 16, 2008 10:42 am 
Senior
Senior

Joined: Wed Sep 19, 2007 9:31 pm
Posts: 191
Location: Khuntien (Indonesia)
you can use third party connection pooling such as DBCP or C3P0. If you don't use other connection pooling, you cann't disable the hibernate connection pooling


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