Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DBCP: removeAbandoned VS eviction

I fail to figure out the difference between removeAbandoned and eviction. I read somewhere that removeAbandoned was deprecated, but it is not mentionned anywhere in the official doc (http://commons.apache.org/dbcp/configuration.html).

So, if someone could enlighten me, it would be greatly appreciated :)

Thanks!

like image 310
Mathieu Avatar asked Jul 06 '11 01:07

Mathieu


People also ask

How does DBCP connection pool work?

The connection user name to be passed to our JDBC driver to establish a connection. The connection password to be passed to our JDBC driver to establish a connection. The connection URL to be passed to our JDBC driver to establish a connection. The fully qualified Java class name of the JDBC driver to be used.

What is DBCP?

DBCP is a fumigant pesticide that was used widely to kill nematodes in soil before planting. Between 1957 and 1977, about 32 million pounds of DBCP were sold and applied yearly in the United States, mainly for soybeans. California used 426,000 pounds at its peak use in 1977.

What is DBCP connection?

The Apache Commons Database Connection Pooling (DBCP) component is the Apache pooling framework used by the publication server for establishing JDBC connections. The jdbc. pool.

What is tomcat DBCP?

Tomcat DBCP is just a renamed version of Apache Commons DBCP, with also a different internal package name prefix. At build time, Tomcat fetches the Commons DBCP sources (the version depends on the Tomcat version, for instance Tomcat 7.0. 27 uses Commons DBCP 1.4), and does package name replacement ( org. apache.


1 Answers

They mean different things:

  • "eviction" occurs when a database connection is unused by the application (idle in the pool) for a long enough period of time at which point it's discarded
  • "abandoned connection" refers to database connection that is still in use by an application after some period of time, usually long enough to indicate that the connection is leaking

Eviction does not indicate a problem with your code (it's just that the application needs fewer connections after a burst of connections) but abandoned connections means that the application is holding on to a connection and is not returning to the pool.

like image 133
Clement P Avatar answered Oct 01 '22 14:10

Clement P