A ResourcePool cannot acquire a new resource -- the factory or source appears to be down
C3P0 and ReplicationDriver causing unserved read traffic when master goes down
C3p0 failover
We faced exactly the same issue and can reproduce it when DB connection pool size < active threads. For sample connection pool 8 connections and 35 active threads which get connections from the pool. C3P0 pool stuck after 8 connections open (can see them from as connections open from DB side) and after with small delay C3P0 pool stuck and all threads become waiting for the next connection from the pool. Threads that keep connection open can't return it to the pool as pool stuck and other threads...
Added log4jdbc and started to trace when connection open/close. Found that when we use hibernate it manage connection state by himself. Basically it close connection when sessionFactory.close() invoked. This is a root cause. So it is not a bug in C3P0 connection. Hibernate sessionFactory just didn't return connection to the pool until it closed. In our case it was due to hibernate.connection.release_mode=on_close. You can configured it behavior via 'hibernate.connection.release_mode'.
Added log4jdbc and started to trace when connection open/close. Found that when we use hibernate it manage connection state by himself. Basically it close connection when sessionFactory.close() invoked. This is a root cause. So it is not a bug in C3P0 connection. Hibernate just didn't returned to the pool from hibernate. In our case it was due to hibernate.connection.release_mode=on_close. You can configured it behavior via 'hibernate.connection.release_mode'.
Added log4jdbc and started to trace when connection open/close. Found that when we use hibernate it manage connection state by himself. Basically it close connection when sessionFactory.close() invoked. This is a root cause. So it is not a bug in C3P0 connection just did returned to the pool from hibernate. Basically you can configured it behavior via 'hibernate.connection.release_mode'
Added log4jdbc and started to trace when connection open/close. Found that when we use hibernate it manage connection state by himself. Basically it close connection when sessionFactory.close() invoked. This is a root cause. So it is not a bug in C3P0 connection just did returned to the pool from hibernate
We faced exactly the same issue and can reproduce it when DB connection pool size < active threads. For sample connection pool 8 connections and 35 active threads which get connections from the pool. C3PO pool stuck after 8 connections open (can see them from as connections open from DB side) and after with small delay C3PO pool stuck and all threads become waiting for the next connection from the pool. Threads that keep connection open can't return it to the pool as pool stuck and other threads...
I found this report because I'm faced with exactly the same thing as reported here. After DB or network outage, c3p0 does not always recover. 'sampleLastAcquisitionFailureStackTrace' shows that acquire has failed due to "IO exception End of TNS data channel" CPU usage on the machine hits 100%, all from c3p0. Any attempt to get a new connection fails with ... "Caused by remote: java.lang.RuntimeException: org.hibernate.exception.GenericJDBCException: Cannot open connection" .... "Caused by: java.sql.SQLException:...
Sir, I am using c3p0-0.9.1 Is this version supports anymore?
Sir, I am using c3p0-0.9.1 Is this version suppors anymore?
Hi, Please try adding cpds.setStatementCacheNumDeferredCloseThreads(1) // pretty...
Hello Steve! Thanks for your reply! I am using c3p0 0.9.5.2 i have a webapplication...
hi 1) what version of c3p0 are you using? 2) consider setting c3p0.statementCacheNumDeferredCloseThreads=1...
What I also got is: 01.07.2016 11:43:19 ERROR: com.microsoft.sqlserver.jdbc.SQLServerException:...
YourKit Warning Frozen threads found (potential deadlock)
What version supports mysql 2014
Update: The issue is no longer observed for more than one month when decreasing the...
More data: the implementation is actively using up to 24 connections and according...
All the parameters listed are set programatically to a ComboPooledDataSource instance...
All the parameters listed are set programatically to a ComboPooledDataSource instance...
hi, threads aren’t locked they are wait()ing. your application very likely has a...
Threads waiting in BasicResourcePool.awaitAvailable forever
<0.9.5-pre8> DeadLocke!!! BLOCKED AT StatementImpl.executeQuery||StatementImpl.realClose
+1 for this, I have the same issue with version 0.9.5.2
Hi, any news
After being advised (in e-mail correspondence) to try unreturnedConnectionTimeout...
Tomcat / MySQL "Zombie" Connection
Tomcat / MySQL "Zombie" Connection
<groupId>com.mchange</groupId> <artifactId>c3p0</artifactId> <version>0.9.5</ver...
first, what version of c3p0 are you using?
If I remove the cache statements c3p0.maxStatementsPerConnection=0 and <property...
java.sql.SQLException: An SQLException was provoked by the following failure: java.lang.RuntimeException: Internal inconsistency: A (not new) checking-out statement is not in deathmarch.
hi, SELECT 1 shouldn’t create any kind of table. The DBMS just selects the constant...
Hi Steve, Good day. I have one query related C3p0's preferredTestQuery parameter....
Hi Steve, Thank you for your reply. we will go ahead withe new version of c3p0 will...
1) if your preferredTestQuery is "SELECT 1", that is what will be tried in order...
Hi Steve, Thank you for immediate reply. My apologies that we got the above deadlock...
Just for the benefit of others that maybe hit this old ticket, the latest version...
No return from getConnectionPool upon drop of packet
So the issue here is pretty clear. A Connection is being closed at the same time...
Expiring connections may cause unnecessary acquire
Hi Steve, As you per you thread, the deadlock is due to old c3p0 jar. We have tested...
Hi. So this is now possible (as of c3p0-0.9.5-pre9, to be released tomorrow I hope,...
If any of you have detailed stack traces to offer, especially with a more recent...
First, please upgrade from 0.9.1.x. It's very old. The deadlock that began this Thread...
PreparedStatement.isClosed() thrown AbstractMethodError
This is fixed in the c3p0 0.9.5 series, which supports all JDBC4 methods.
Hi, It's very likely that you are letting multiple Threads work with your Statements...
Hi Steve, Thanks for the response and helping me to understand. We do not use any...
Hi. The Exception you are catching is not a NullPointerException, but an SQLException,...
Hi Steve Waldman, I am using c3p0-0.9.2 and and still getting the issue of Null pointer...
Also ResultSet.isClosed() Exception in thread "main" java.lang.reflect.InvocationTargetException...
We are having this issue and due to this the CPU get hung 100%. Any help on this...
hi, so there is new API that almost, but not quite, will let you do what you want...
The memory leak problem is resolved. Thanks you. I can do all using property files...
The memory leak problem is resolved. Thanks you. I can do all using property files...
A ResourcePool cannot acquire a new resource -- the factory or source appears to be down.
c3p0 configuration in jboss-as-7.1.1
Unexpected error during load of: com.mchange.v2.c3p0.jboss.C3P0PooledDataSource, msg=Bad version number in .class file
Unexpected error during load of: com.mchange.v2.c3p0.jboss.C3P0PooledDataSource, msg=Bad version number in .class file
glad to hear it!
Hi Steve, Thanks a lot for your timely response,now its working fine !!!
hi, c3p0-0.9.5.x is compiled for JDK6+. under jdk 1.5.16, you’ll need to back-off...
hi, c3p0-0.9.5 prereleases are JDK6+. to run under a jdk 1.5 JVM, you will need to...
hi, c3p0-0.9.5 prereleases are JDK6+. to run under a jdk 1.5 JVM, you will need to...
attached is error stack trace