-->
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.  [ 1 post ] 
Author Message
 Post subject: C3P0 Configuration
PostPosted: Tue Jun 08, 2010 4:38 pm 
Newbie

Joined: Sat Dec 05, 2009 1:34 am
Posts: 12
I have a Spring/JPA application with Hibernate as the JPA provider. I've configured a C3P0 data source in Spring via:

Code:
   <bean id="myAppJdbcDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
      destroy-method="close">
      <!-- Connection properties -->
      <property name="driverClass" value="$DS{database.class}" />
      <property name="jdbcUrl" value="$DS{database.url}" />
      <property name="user" value="$DS{database.username}" />
      <property name="password" value="$DS{database.password}" />

      <!-- Pool properties -->
      <property name="minPoolSize" value="5" />
      <property name="maxPoolSize" value="20" />
      <property name="maxStatements" value="50" />
      <property name="idleConnectionTestPeriod" value="3000" />
      <property name="loginTimeout" value="300" />
   </bean>


I then specify this data source in the Spring entity manager factory as follows:

Code:
   <bean id="myAppLocalEmf"
      class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
      <property name="persistenceUnitName" value="myapp-core" />
      <property name="dataSource" ref="myAppJdbcDataSource" />
   </bean>


I recently noticed while browsing maven artifacts a "hibernate-c3p0". What is this? Is this something I need to use? Or do I already have this configured properly?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.