Questions tagged [apache-commons-dbcp]

Apache-commons-dbcp provides an efficient implementation of the Database Connection Pool under the Apache license.

Many projects support interaction with a relational database. Creating a new connection for each user can be time consuming (often requiring multiple seconds of clock time), in order to perform a database transaction that might take milliseconds. Opening a connection per user can be unfeasible in a publicly-hosted Internet application where the number of simultaneous users can be very large. Accordingly, developers often wish to share a "pool" of open connections between all of the application's current users. The number of users actually performing a request at any given time is usually a very small percentage of the total number of active users, and during request processing is the only time that a database connection is required. The application itself logs into the DBMS, and handles any user account issues internally.

Apache-commons-dbcp coordinates the efforts required to create and maintain an efficient, feature-rich Database Connection Pool package under the ASF.

394 questions
3
votes
1 answer

How can I configure NiFi's DBCPConnectionPool not to keep idle connections open?

Out of the box, NiFi (at least, as of 1.8.0), appears to keep open one database connection for each DBCPConnectionPool controller service enabled. I have multiple DBCPConnectionPool controller services configured to access the same server with…
Colin Dean
  • 1,429
  • 1
  • 15
  • 26
3
votes
0 answers

Unnecessary ROLLBACK's with BasicDataSource from commons-dbcp

If BasicDataSource from Apache commons-dbcp (version 1.4, as I'm limited to Java 1.6) is configured with defaultAutoCommit=false, then two extra ROLLBACK's are executed, one when a database connection is taken from the pool, and another one when…
Bass
  • 4,977
  • 2
  • 36
  • 82
3
votes
2 answers

Question regarding org.apache.commons.dbcp.BasicDataSource

I fixed some bug related to the way we were using BasicDataSource and though I understand part of it I still have some questions unanswered :) Problem: The application was not able to auto-connect to the database after a db failure. Application is…
codeObserver
  • 6,521
  • 16
  • 76
  • 121
3
votes
1 answer

DBCP 1.3 Validation Query Degrading Performance

I am working on a Spring-Batch where I am using an embedded DataSource (Apache Commons DBCP 1.3), JDBC3 db2jcc.jar for BD2 database and JDK1.5. I know DBCP2.x is already released but because of existing system (JDK 1.5) I cannot upgrade right…
3
votes
1 answer

JPA/EclipseLink: Understanding ClassLoader issues

EDIT: Although a (good) answer was given and awarded, this only covers a rather unimportant part of my question. The main parts of this question are still open. I use EclipseLink (2.6.2) in a cloud project. The project is a web application packaged…
C-Otto
  • 5,615
  • 3
  • 29
  • 62
3
votes
1 answer

Kerberos and Integrated Security using jTDS Driver

Up till now we were using MS JDBC Driver 4.0 to connect to SQL Server 2008 using Integrated Security and Java Kerberos and everything was working fine. Here is the code: Spring Context:
user2004685
  • 9,548
  • 5
  • 37
  • 54
3
votes
0 answers

H2 with heavy data + dbcp2 2.1.0 creating deadlock at borrowObject

I have H2 database with cache increased to 1.5GB for some heavy data loading. Currently using dbcp2 2.1.0 version. I have not enabled dbcp2 statement pooling yet. What I have observed is , when I reduce down the data loaded in H2, dbcp2 works…
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
3
votes
1 answer

In the java DBCP connection pool - what is an idle connection?

A colleague at work insists that a DBCP idle connection is a connection that has lain unused for 30 minutes. I believe a dbcp idle connection is a connection that is in the pool available to be borrowed, and an active connection is one that is…
cmdematos
  • 883
  • 4
  • 12
  • 24
3
votes
2 answers

Maven co-ordinates for commons dbcp 2.0

I want to use Commons-DBCP 2.0. On official site i found: Users upgrading to 2.x should be aware that the Java package name has changed, as well as the Maven co-ordinates, since DBCP 2.x is not binary compatible with DBCP 1.x. But what are the new…
dermoritz
  • 12,519
  • 25
  • 97
  • 185
3
votes
2 answers

Get number of free connections in connection pool

In my project Spring manages connection pool with org.apache.commons.dbcp.BasicDataSource class. Is possible to get how many connections are free or used in current time? Thanks.
sinuhepop
  • 20,010
  • 17
  • 72
  • 107
3
votes
1 answer

DBCP Idle Connections not being reused in Camel Route

I am pretty sure the idle connections are not being re-used or I am leaking connections. I have a simple route that start from a file consumer. The file consumer consumes text files. After picking up the file I check a table to ensure that this is…
Namphibian
  • 12,046
  • 7
  • 46
  • 76
3
votes
2 answers

Apache Commons DBCP strange behavior

I'm trying to figure out a problem that we have in a high traffic site using Tomcat 6.0.37 and MySQL 5.5 underneath the cover. The test load was 200 concurrent connections to Tomcat - all connections to the same URL and all of them hitting the…
3
votes
2 answers

apache commons| pool or pool2

I was just trying to use DataSource from apache commons-dbcp.jar. For that I just downloaded one of their example. So far so good. Example stand as (this) // Here are the dbcp-specific classes. // Note that they are only used in the…
mawia
  • 9,169
  • 14
  • 48
  • 57
3
votes
1 answer

Spring connection pooling configurations

I've been searching around the web for some time now and i've yet to fix this issue: I have the following datasource configuration:
Nuno Furtado
  • 4,548
  • 8
  • 37
  • 57