Questions tagged [jdbc-pool]

JDBC pool is a pool of JDBC connections to a common data source. Pooling JDBC connection is a common practice to avoid expensive JDBC connection creation.

JDBC pool is a pool of JDBC connections to a common data source. Pooling JDBC connection is a common practice to avoid expensive JDBC connection creation.

External libraries implementing the JDBC pooling can be used to further boost the performance. Examples of such libraries are Apache Database Connection Pool., , Tomcat JDBC Pool, , .

Relevant Q/A:

73 questions
20
votes
3 answers

attempt to reconnect jdbc pool datasource after database restarts

I have a web-app with a Java back-end that uses Tomcat jdbc-pool for database connections. This works fine. However I am trying to foolproof it before exporting it to other locations, and recently a scenario occurred where someone restarted the SQL…
egerardus
  • 11,316
  • 12
  • 80
  • 123
16
votes
2 answers

Increase load and decrease performance while replace DBCP to Tomcat JDBC-pool

After problems with connection leak and deadlocks in DBCP we made a decision to replace it with Tomcat JDBC-pool. Of course migration was really simple. But after deploy it on a production environment I noticed, that load on a server with running…
Dzinek
  • 786
  • 7
  • 17
13
votes
5 answers

Is "Tomcat 7 JDBC Connection Pool" good enough for production? And how is it compare to BoneCP?

Our site get roughly 1M pv/day, and we use Tomcat for sure. I couldn't find much information about jdbc-pool, not sure if it's stable enough for production. Anyone got experience on it? and any configuration/tuning stuff for reference? As someone…
BigFatSea
  • 473
  • 1
  • 6
  • 13
11
votes
1 answer

How to track/log connections in tomcat dbcp pool and detect code that does not return connection to the pool

Somewhere in a large application, there is some piece of code that does not return a connection to the connection pool as it should. The result is that that the pool reaches quickly the maximum connections. This can be worked around by setting it to…
10
votes
2 answers

ClassNotFoundException when upgraded to Tomcat 8

I recently upgraded my NetBeans IDE from v7.3 to v8 and all of a sudden my application throws an exception at server startup while connecting to DB. The only difference between these two versions of IDE are that the later one is using Tomcat…
Nital
  • 5,784
  • 26
  • 103
  • 195
5
votes
4 answers

Tomcat error: java.sql.SQLException: No suitable driver found for jdbc:sqlserver://

I have a terrible problem with Tomcat, well terrible because of this problem I've thrown away the project for more than a month now... Yet I'll still need to solve it and to go on with the project... So it's throwing me this…
Arturas M
  • 4,120
  • 18
  • 50
  • 80
4
votes
1 answer

Database connections count greater than that set by DBCP maxTotal

I am running a java web application using Tomcat (version 8.0.43). I moved the tomcat-dbcp.jar (which came with Tomcat8.0.43) to jdk/jre/lib/ext so that it's available to the jre. I think that I am using the Tomcat DBCP (as opposed to Apache Commons…
theyuv
  • 1,556
  • 4
  • 26
  • 55
4
votes
0 answers

How to configure Tomcat JDBC Pool for a load balanced cluster (like PostgreSQL Master-Slave Replication)

Let's assume there is a PostgreSQL cluster consisting of a single master node and two read-only replicas via streaming replication. How can I configure Tomcats DBCP to be aware that there are several different nodes within the db cluster, thus…
4
votes
0 answers

Java - get the number of active connections while using Tomcat JDBC Connection Pooling

In Apache DBCP there is a method getMaxActive() to get the number of active connections. I am trying to use Tomcat JDBC Connection Pooling. I am able to create a datasource and use it to run my query but I want to print to my console to see how many…
user547453
  • 1,035
  • 6
  • 22
  • 38
4
votes
3 answers

Java - DBCP vs JNDI?

I am a newbie and I have created a few simlpe Java Swing applications. I was able to use apache commons DBCP to create a connection pool and access the datasource. I have recently started to create java web based applciations using JSP and Servlets.…
user547453
  • 1,035
  • 6
  • 22
  • 38
3
votes
1 answer

DBCP object created ... by the following code was never closed

we have troubles with not closed connections to DB in our application. I was trying everything, so I got to experimenting with DBCP. Here are steps to reproduce problem: 1) I've installed on Windows: clean apache-tomcat-7.0.59 Java 1.7.0_75 2)…
M.Mayer
  • 31
  • 1
  • 3
3
votes
1 answer

Apache Tomcat JDBC Connection Pool bad performance on batch \ bulk inserts

I have recently incorporated the Apache Tomcat JDBC Connection Pool to my application (using MySQL DB). I tried using Apache DBCP before, but didn't like its results, and the tomcat implementation seemed to fit my needs even though I run a…
KidCrippler
  • 1,633
  • 2
  • 19
  • 34
3
votes
2 answers

Alive or Idle connections on JDBC

It seems that JDBC Spec does not elaborate the accurate meanings of alive or idle connections in the datasource connection pool. Is it just implementation specific? How does DBCP2 or HikariCP actually inspect the connection status? Will a…
sof
  • 9,113
  • 16
  • 57
  • 83
2
votes
1 answer

Grails. Cannot get a connection, pool exhausted

After reworking one service method in order to use multithreading I found out that if more than one user is trying to request page (and call service method) many times, the server begins throwing "Cannot get a connection, pool exhausted" exception.…
volea
  • 31
  • 5
2
votes
1 answer

Why DBCP getNumIdle always return 0? When does active connection become idle?

I'm using DBCP2 BasicDataSource to manage database connections. When I test I use getNumActive() and getNumIdle() to print out the pool status. I end up active connections keep on increasing while idle connection always 0. Here is my code: …
Roger Guo
  • 53
  • 6
1
2 3 4 5