[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2343?page=c...
]
Grant Ingersoll commented on HHH-2343:
--------------------------------------
I too am seeing multiple initializations of c3p0 and it appears during schema update, I
believe, but haven't completely isolated it to there. Am using 3.2.1 and annotations
on Postgresql 8.2, java 1.5 on OS X 10.4
cp30 config is:
<property name="hibernate.c3p0.min_size">5</property>
<property name="hibernate.c3p0.max_size">50</property>
<property name="hibernate.c3p0.timeout">0</property>
<!--
See
http://forum.hibernate.org/viewtopic.php?t=947246&highlight=apparent+...
for why this is set to 0
-->
<property name="hibernate.c3p0.max_statements">0</property>
SchemaUpdate and c3p0 connection pool too many connections
----------------------------------------------------------
Key: HHH-2343
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2343
Project: Hibernate3
Type: Bug
Components: build
Versions: 3.2.1
Environment: hibernate 3.2.1.ga, hibernate-annotations, oracle ojdbc14_g 10.2.0.2, c3p0
0.9.0 or 0.9.0.4, Sun Java 1.5.0.10, Win XP.
Reporter: Vlad Skarzhevskyy
- I have application, configured to use c3p0 as connection pool
<property name="c3p0.max_size">2</property>
- When SchemaUpdate is enabled
<property name="hibernate.hbm2ddl.auto">update</property>
Application (hibernate) creates ~100 connections to database and c3p0 pool initialized
42 times. (looks like number of entities in my domain)
There are no problems like this in hibernate 3.2.0.ga
I see this log statement 42 times in log
INFO Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@15a4a77
[ ... initialPoolSize -> 2, ... maxPoolSize -> 2, ]
INFO 2007-01-04 13:39:55,796 2031- [..] [C3P0Registry.banner:77]
com.mchange.v2.c3p0.C3P0Registry.banner(C3P0Registry.java:77) [main]
Initializing c3p0-0.9.0.4 [built 23-January-2006 22:20:29 -0500; debug? true; trace:
10]
INFO 2007-01-04 13:39:56,093 2328- [..] [PoolBackedDataSource.getPoolManager:257]
com.mchange.v2.c3p0.PoolBackedDataSource.getPoolManager(PoolBackedDataSource.java:257)
[main]
Initializing c3p0 pool... com.mchange.v2.c3p0.PoolBackedDataSource@bc312f [
connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@5f1ba8
[ acquireIncrement -> 1, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000,
autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure
-> false, checkoutTimeout -> 0, connectionTesterClassName ->
com.mchange.v2.c3p0.impl.DefaultConnectionTester, factoryClassLocation -> null,
forceIgnoreUnresolvedTransactions -> false, identityToken -> 5f1ba8,
idleConnectionTestPeriod -> 3000, initialPoolSize -> 2, maxIdleTime -> 5000,
maxPoolSize -> 2, maxStatements -> 100, maxStatementsPerConnection -> 0,
minPoolSize -> 2, nestedDataSource ->
com.mchange.v2.c3p0.DriverManagerDataSource@13c4c09 [ description -> null, driverClass
-> null, factoryClassLocation -> null, identityToken -> 13c4c09, jdbcUrl ->
jdbc:oracle:thin:@torvspocapp:1522:ENT10, properties -> {user=******, password=******}
], preferredTestQuery -> null, propertyCycle -> 300, testConnectionOnCheckin ->
false, testConnectionOnCheckout -> false, usesTraditionalReflectiveProxies -> false
], factoryClassLocation -> null, identityToken -> bc312f, numHelperThreads -> 3
]
......
And so on 42 times.
hibernate.cfg.xml
----
<property
name="hibernate.connection.pool_size">0</property>
<property name="c3p0.acquire_increment">1</property>
<property name="c3p0.min_size">2</property>
<property name="c3p0.max_size">2</property>
<property name="c3p0.timeout">5000</property>
<property name="c3p0.idle_test_period">3000</property>
<property name="c3p0.max_statements">100</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<property
name="hibernate.bytecode.use_reflection_optimizer">false</property>
----
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira