-->
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: How to configure C3P0 in Hibernate.cfg.xml?
PostPosted: Sat Aug 18, 2007 1:19 am 
Newbie

Joined: Wed Nov 08, 2006 5:35 am
Posts: 4
Hello everyone,
My hibernate.cfg.xml as follows:
Code:
   <?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
          "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
          "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<!-- Generated by MyEclipse Hibernate Tools.                   -->
<hibernate-configuration>
        <session-factory>
                <property name="connection.username">zzflash</property>

                <property name="connection.url">
                        jdbc:mysql://59.64.180.132:3306/CommuPlatform?autoReconnect=true
                </property>

                <property name="dialect">
                        org.hibernate.dialect.MySQLDialect
                </property>

                <property name="myeclipse.connection.profile">
                        CommuPlatform
                </property>

                <property name="connection.password">zzflash</property>

                <property name="connection.driver_class">
                        com.mysql.jdbc.Driver
                </property>

                <property name="connection.provider_class">
                        org.hibernate.connection.C3P0ConnectionProvider
                </property>

                <property name="c3p0.minPoolSize">5</property>

                <property name="c3p0.maxPoolSize">30</property>

                <property name="c3p0.initialPoolSize">10</property>

                <property name="c3p0.automaticTestTable">Test</property>

                <property name="c3p0.maxIdleTime">25000</property>

                <property name="c3p0.acquireIncrement">5</property>

                <property name="c3p0.maxStatements">0</property>

                <property name="c3p0.idleConnectionTestPeriod">18000</property>

                <property name="c3p0.acquireRetryAttempts">10</property>

                <property name="c3p0.breakAfterAcquireFailure">false</property>

                <property name="c3p0.testConnectionOnCheckout">true</property>

                <property name="c3p0.testConnectionOnCheckin">true</property>

                <property name="cache.use_second_level_cache">false</property>

                <property name="cache.use_query_cache">false</property>
               
                <mapping resource="com/serviceinall/db/notice/Notice.hbm.xml" />

                <mapping resource="com/serviceinall/db/project/Project.hbm.xml" />

                <mapping resource="com/serviceinall/db/file/File.hbm.xml" />

                <mapping resource="com/serviceinall/db/task/Task.hbm.xml" />

                <mapping resource="com/serviceinall/db/user/User.hbm.xml" />

                <mapping
resource="com/serviceinall/db/groupuser/Groupuser.hbm.xml" />

                <mapping resource="com/serviceinall/db/ugroup/Ugroup.hbm.xml" />
        </session-factory>
</hibernate-configuration>


but when starting the log report as follows:
Code:
Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@317af5c1
[
   connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@2b00958d
   [
      acquireIncrement -> 1,
      acquireRetryAttempts -> 30,
      acquireRetryDelay -> 1000,
      autoCommitOnClose -> false,
      automaticTestTable -> null,
      breakAfterAcquireFailure -> false,
      checkoutTimeout -> 0,
      connectionCustomizerClassName -> null,
      connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester,
      debugUnreturnedConnectionStackTraces -> false,
      factoryClassLocation -> null,
      forceIgnoreUnresolvedTransactions -> false,
      identityToken -> z8kflt7own60on1osw421|135133,
      idleConnectionTestPeriod -> 0,
      initialPoolSize -> 1,
      maxAdministrativeTaskTime -> 0,
      maxConnectionAge -> 0,
      maxIdleTime -> 0,
      maxIdleTimeExcessConnections -> 0,
      maxPoolSize -> 100,
      maxStatements -> 0,
      maxStatementsPerConnection -> 0,
      minPoolSize -> 1,
      nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@e698dfdf
      [
         description -> null,
         driverClass -> null,
         factoryClassLocation -> null,
         identityToken -> z8kflt7own60on1osw421|1a3aa2c,
         jdbcUrl -> jdbc:mysql://59.64.180.132:3306/CommuPlatform?autoReconnect=true,
         properties ->
         {
            user=******,
            password=******,
            release_mode=on_close
         }
      ],
      preferredTestQuery -> null,
      propertyCycle -> 0,
      testConnectionOnCheckin -> false,
      testConnectionOnCheckout -> false,
      unreturnedConnectionTimeout -> 0,
      usesTraditionalReflectiveProxies -> false;
      userOverrides: {}
   ],
   dataSourceName -> null,
   factoryClassLocation -> null,
   identityToken -> z8kflt7own60on1osw421|1588325,
   numHelperThreads -> 3
]

All cofiguration uses the default values, is there anywhere I misconfigured or something?
Please help, Thanks very much!


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 18, 2007 3:38 am 
Newbie

Joined: Wed Nov 08, 2006 5:35 am
Posts: 4
OK, I have tried and found that only six properties of c3p0 is supported in hibernate.cfg.xml,that is the six constant fields defined in class Envrionment related with c3p0, and by doing so, it works. But what if I want to configure other properties of c3p0 pool, how can I do it?
Thanks


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.