-->
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: c3p0 not being invoked at all
PostPosted: Thu Mar 04, 2010 1:35 pm 
Regular
Regular

Joined: Thu Sep 16, 2004 4:56 pm
Posts: 80
I dropped c3p0 jars in my WEB-INF/lib....


I only see this in the logs(And I turned up to FINEST at one point...simply no logging on how hibernate is loading the pools)...

FINE: ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
Mar 4, 2010 10:31:34 AM org.hibernate.validator.ClassValidator getDefaultResourceBundle
FINE: ResourceBundle ValidatorMessages not found in Validator classloader. Delegate to org.hibernate.validator.resources.DefaultValidatorMessages
Mar 4, 2010 10:31:35 AM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Using Hibernate built-in connection pool (not for production use!)
Mar 4, 2010 10:31:35 AM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Hibernate connection pool size: 20
Mar 4, 2010 10:31:35 AM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: autocommit mode: true

and I have this in my persistence.xml file...

Code:
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
               http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
          version="1.0">
   <!-- This should be named oracle to let every app use it
        not be named webrates... -->
   <persistence-unit name="xcoreNonJtaOracle">
      <provider>org.hibernate.ejb.HibernatePersistence</provider>
      <properties>
     
         <property name="hibernate.hbm2ddl.auto" value="validate"/>
         <property name="hibernate.default_schema" value="VOICELOG"/>
         
               <property name="hibernate.c3p0.min_size" value="5"/>
      <property name="hibernate.c3p0.max_size" value="21"/>
      <property name="hibernate.c3p0.timeout" value="5001"/>
      <property name="hibernate.c3p0.max_statements" value="51"/>
      <property name="hibernate.c3p0.idle_test_period" value="60001"/>
     
          <property name="transaction.flush_before_completion" value="true"/>    
         <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
         <property name="hibernate.connection.driver_class" value="net.sf.log4jdbc.DriverSpy"/>
         <property name="hibernate.connection.username" value="vl_user"/>
         <property name="hibernate.connection.password" value="vluser01"/>
         <property name="hibernate.connection.url" value="jdbc:log4jdbc:oracle:thin:@10.10.250.120:1521:ractest"/>         
         <!--property name="hibernate.connection.url" value="jdbc:log4jdbc:oracle:thin:@192.168.140.45:1521:codev01"/-->
         <property name="hibernate.show_sql" value="false"/>
         <property name="hibernate.format_sql" value="true"/>
         <property name="hibernate.order_updates" value="true"/>
         <property name="hibernate.default_batch_fetch_size" value="100"/>
         <property name="hibernate.jdbc.batch_versioned_data" value="true"/>
         <property name="hibernate.jdbc.use_streams_for_binary" value="true"/>
         <property name="hibernate.cache.region_prefix" value="hibernate.test"/>
         <property name="hibernate.cache.use_query_cache" value="true"/>
         <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
         <property name="hibernate.query.substitutions" value="true 1, false 0, yes 'Y', no 'N'"/>
      </properties>
   </persistence-unit>
         
   <persistence-unit name="xcoreNonJta">
     <provider>org.hibernate.ejb.HibernatePersistence</provider>
      <properties>
         <property name="hibernate.hbm2ddl.auto" value="update"/>
         <property name="hibernate.default_schema" value="VOICELOG"/>

      <property name="hibernate.c3p0.min_size" value="5"/>
      <property name="hibernate.c3p0.max_size" value="21"/>
      <property name="hibernate.c3p0.timeout" value="5001"/>
      <property name="hibernate.c3p0.max_statements" value="51"/>
      <property name="hibernate.c3p0.idle_test_period" value="60001"/>
      
        <property name="transaction.flush_before_completion" value="true"/>
         <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
         <property name="hibernate.connection.driver_class" value="net.sf.log4jdbc.DriverSpy"/>
         <property name="hibernate.connection.username" value="application"/>
         <property name="hibernate.connection.password" value="application123"/>
         <property name="hibernate.connection.url" value="jdbc:log4jdbc:postgresql://localhost/agent"/>
         <property name="hibernate.max_fetch_depth" value="3"/>
         <property name="hibernate.show_sql" value="false"/>
       <property name="hibernate.format_sql" value="true"/>
         <property name="hibernate.order_updates" value="true"/>
         <property name="hibernate.default_batch_fetch_size" value="100"/>
         <property name="hibernate.jdbc.batch_versioned_data" value="true"/>
         <property name="hibernate.jdbc.use_streams_for_binary" value="true"/>
         <property name="hibernate.cache.region_prefix" value="hibernate.test"/>
         <property name="hibernate.cache.use_query_cache" value="true"/>
         <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
         <property name="hibernate.query.substitutions" value="true 1, false 0, yes 'Y', no 'N'"/>
      
      </properties>
   </persistence-unit>
</persistence>



Why is hibernate using it's connection pool instead of c3p0?
thanks,
Dean

_________________
The list of compelling reasons to reduce the estimate does not include you simply wishing it would take less time - Unknown


Top
 Profile  
 
 Post subject: Re: c3p0 not being invoked at all
PostPosted: Fri Mar 05, 2010 6:57 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
you configured c3p0 but never told hibernate to use it:
Code:
<property name="connection.provider_class" value="org.hibernate.connection.C3P0ConnectionProvider" />

_________________
Sanne
http://in.relation.to/


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.