-->
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.  [ 2 posts ] 
Author Message
 Post subject: Connection Pooling with DBCP configuration question.
PostPosted: Fri Feb 19, 2010 4:55 am 
Newbie

Joined: Fri Feb 19, 2010 2:50 am
Posts: 1
I'm new to Hibernate and have been searching for information about connection pooling.

I understand that plugging in any connection pool library is supposed to be a trivial affair in Hibernate yet have been unable to get it to work for me.

I would like to use DBCP and have downloaded: commons-pool-1.5.4.jar and commons-dbcp-1.3.jar and included them on my classpath. From there I pieced together this hibernate.cnf.xml file based on information scattered around the internet:

<hibernate-configuration>
<session-factory>
<property
name="hibernate.connection.provider_class"> *** I DON'T KNOW WHAT GOES HERE ***
</property>

<property name="hibernate.dbcp.maxActive">8</property>
<property name="hibernate.dbcp.maxIdle">8</property>
<property name="hibernate.dbcp.maxWait">100</property>
<property name="hibernate.dbcp.whenExhaustedAction">1</property>
<property name="hibernate.dbcp.testOnBorrow">true</property>
<property name="hibernate.dbcp.testOnReturn">true</property>
<property name="hibernate.dbcp.ps.maxActive">8</property>
<property name="hibernate.dbcp.ps.maxIdle">8</property>
<property name="hibernate.dbcp.ps.maxWait">1000*60*30</property>
<property name="hibernate.dbcp.ps.whenExhaustedAction">1</property>


<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/hibernate01</property>
<property name="hibernate.connection.username">something</property>
<mapping resource="model/MyWonderfulObject.hbm.xml"/>
</session-factory>
</hibernate-configuration>

Bow I'm stuck not knowing what class to include for the "hibernate.connection.provider_class"

Can anyone enlighten a simpleton such as myself.

And if, when casting a glancing eye over the configuration file, you find anything else out of place please let me know.

Thanks, this has been hard going.


Top
 Profile  
 
 Post subject: Re: Connection Pooling with DBCP configuration question.
PostPosted: Fri Feb 19, 2010 7:14 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
There is no DBCPConnectionProvider included in hibernate distribution,
probably because DBCP is typically used in conjuction with JTA (datasource) where a connectionprovider is not needed.
Anyway you can find here one

http://wiki.apache.org/commons/DBCP/Hibernate


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