Questions tagged [c3p0]

c3p0 is a Java library for JDBC drivers with JNDI-bindable DataSources, including DataSources that implement Connection and Statement Pooling, as described by the jdbc3 spec and jdbc2 std extension.

C3p0

C3p0 is an easy-to-use library for augmenting traditional (DriverManager-based) JDBC drivers with JNDI-bindable DataSources, including DataSources that implement Connection and Statement Pooling, as described by the jdbc3 spec and jdbc2 std extension.

A common use case for c3p0 is to replace the standard DBCP connection pooling included with Apache Tomcat. Often times, a programmer will run into a situation where connections are not correctly recycled in the DBCP connection pool and c3p0 is a valuable replacement in this case.

References

1148 questions
22
votes
2 answers

Caused by: org.postgresql.util.PSQLException: FATAL: remaining connection slots are reserved for non-replication superuser connections

I use c3p0-0.9.5.2.jar and mchange-commons-java-0.2.11.jar to manage the pool connection, And I use postgreSql 9.3. I get these messages at least once a day in my Prod environment : Caused by: java.sql.SQLException: Connections could not be acquired…
franco
  • 1,829
  • 6
  • 42
  • 75
19
votes
5 answers

Lot of SHOW TRANSACTION ISOLATION LEVEL queries in postgres

I am using Hibernate 4, PostgreSQL and C3P0. In my web application, after sometime I am getting multiple SHOW TRANSACTION ISOLATION LEVEL queries in database due to which my server gets hang. In my code all my connections are properly closed. Is it…
Ricky
  • 191
  • 1
  • 1
  • 3
18
votes
6 answers

com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source

I have MySQL under my Hibernate and I am also using c3p0-0.9.1 for connection pool. When running on my laptop (I mean locally) I have no errors. But when I deploy it on the server, I get this…
moien goli
  • 181
  • 1
  • 1
  • 3
18
votes
2 answers

should i activate c3p0 statement pooling?

we are running java6/hibernate/c3p0/postgresql stack. Our JDBC Driver is 8.4-701.jdbc3 I have a few questions about Prepared Statements. I have read excellent document about Prepared Statements But i still have a question how to configure c3p0 with…
Janning Vygen
  • 8,877
  • 9
  • 71
  • 102
17
votes
5 answers

Hibernate 4.1 with HSQLDB gives 'data exception: string data, right truncation'

I have a very strange problem, got it when I upgraded som deps to the project. I'm now using following versions: Spring: 3.1.0.RELEASE Hibernate: 4.1.7.Final Hsqldb: 2.2.8 (org.hsqldb) I THINK the problem has to do something with the file field.…
Kronis
  • 237
  • 1
  • 2
  • 9
16
votes
3 answers

hibernate with c3p0: createClob() is not yet implemented

In my project I started to use c3p0 with hibernate for reconnecting to database as hibernate won't restore connection on db failure. org.hibernate hibernate-c3p0
greengold
  • 1,184
  • 3
  • 18
  • 43
16
votes
1 answer

How to log JDBC connection activity?

How can I see when my pooling library (C3P0) is creating and closing JDBC connections? Note: I have done research on this and already found a solution. I'm posting it here so that it may be useful to others and I can refer back to it in case I…
Kshitiz Sharma
  • 17,947
  • 26
  • 98
  • 169
16
votes
2 answers

PreparedStatement caching - what does it mean (how does it work)

I'm using for example c3p0 with some defined "maxStatements" for preparedStatement caching. What does this caching really do? What kind of data it caches. On what level (db, application,..)? It would be nice to understand it from example. For…
adsurbum
  • 3,107
  • 3
  • 22
  • 27
15
votes
5 answers

Hibernate, C3P0, Mysql -- Broken Pipe

MySQL seems to have an 8 hour time out on its connections. I'm running multiple WARs in Tomcat utilizing Hibernate for ORM. After 8 hours (i.e. overnight), I get broken pipes when it picks up an idle connection. I've already traced through the code…
Mark
  • 4,446
  • 5
  • 26
  • 34
15
votes
2 answers

Hibernate: Deadlock found when trying to obtain lock

I am using hibernate in my project and I am getting random Apparent Deadlocks for very simple database operations. There is one of the Stack Traces: https://gist.github.com/knyttl/8999006 – What confuses me, that the first Exception is…
Vojtěch
  • 11,312
  • 31
  • 103
  • 173
15
votes
0 answers

Use c3p0 with JBOSS AS 7.1.1

I read in c3p0´s manual link that it is possible to use c3p0 library inside JBOSS as an MBean. Once configured correctly, I would like to reference the new C3P0PooledDataSource in my Java WAR through its JNDI name. As I am using Spring it would be…
aloplop85
  • 892
  • 3
  • 16
  • 40
14
votes
2 answers

How to monitor c3p0 connections

I am using Hibernate in my JBoss war, using c3p0 for connection pooling, both configured within a hibernate.cfg.xml config file in my classpath
Llistes Sugra
  • 991
  • 4
  • 9
  • 24
14
votes
1 answer

c3p0 acronym origin - jdbc connection pool name

Can anyone share the origin and meaning of the jdbc connection pool named c3p0. Was it inspired from star wars?.
Anna
  • 435
  • 1
  • 5
  • 7
14
votes
3 answers

Jetty 7 + MySQL Config [java.lang.ClassNotFoundException: org.mortbay.jetty.webapp.WebAppContext]

I've been trying to get a c3p0 db connection pool configured for Jetty, but I keep getting a ClassNotFoundException: 2010-03-14 19:32:12.028:WARN::Failed startup of context…
Scott Chang
  • 181
  • 1
  • 1
  • 5
14
votes
3 answers

Reproduce com.mysql.jdbc.exceptions.jdbc4.CommunicationsException with a setup of Spring, hibernate and C3P0

I got this error from the production code: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was36940 seconds ago.The last packet sent successfully to the server was 36940 seconds…
fei
  • 2,224
  • 9
  • 31
  • 36
1
2
3
76 77