You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Döscher, Andreas (ESI)" <an...@adp.com.INVALID> on 2024/02/16 07:21:43 UTC

ConnectionPool JDBC vs. DBCP

Moin,
in the docpage https://tomcat.apache.org/tomcat-10.1-doc/jdbc-pool.html it says

>The JDBC Connection Pool org.apache.tomcat.jdbc.pool is a replacement or an alternative to the Apache Commons DBCP connection pool.
>
>So why do we need a new connection pool?
>
>Here are a few of the reasons:
>
>    Commons DBCP 1.x is single threaded. In order to be thread safe Commons locks the entire pool for short periods during both object allocation and object return. Note that this does not apply to Commons DBCP 2.x.
[...snip...]

I thought that Tomcat uses DBCP 2.x per default, is this document still relevant or is it outdated?

Thanks,
  Andreas



This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, notify the sender immediately by return email and delete the message and any attachments from your system.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: ConnectionPool JDBC vs. DBCP

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Andreas,

On 2/16/24 02:21, Döscher, Andreas (ESI) wrote:
> Moin,
> in the docpage https://tomcat.apache.org/tomcat-10.1-doc/jdbc-pool.html it says
> 
>> The JDBC Connection Pool org.apache.tomcat.jdbc.pool is a replacement or an alternative to the Apache Commons DBCP connection pool.
>>
>> So why do we need a new connection pool?
>>
>> Here are a few of the reasons:
>>
>>     Commons DBCP 1.x is single threaded. In order to be thread safe Commons locks the entire pool for short periods during both object allocation and object return. Note that this does not apply to Commons DBCP 2.x.
> [...snip...]
> 
> I thought that Tomcat uses DBCP 2.x per default, is this document still relevant or is it outdated?

Recent versions of Tomcat do indeed use DBCP2.

You are reading the documentation for the pool itself, which is 
justifying the reason it was developed in the first place, back when 
Tomcat shipped with DBCP1. DBCP2 was created for many of the same 
reasons tomcat-pool was created, just on different schedules.

This document could be updated to make it clear that the comparison of 
tomcat-pool against DBCP1 is a historical comparison, and that Tomcat 
now uses DBCP2 by default which does not suffer from the same problems 
tomcat-pool was designed to address.

There are some significant architectural and feature differences between 
DBCP2 and tomcat-pool which is why we haven't shut the sub-project down.

-chris

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org