This is an automated email from the ASF dual-hosted git repository.

rmaucher pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit c7f108fb5bd591c118b1bfa825bc165c37817d2e
Author: opencode <[email protected]>
AuthorDate: Fri Nov 6 11:10:05 2026 +0100

    Clarify PoolConfiguration defaults and data source backing
    
    Describe maxIdle as defaulting to maxActive (100 by default), and document 
that a ConnectionPoolDataSource can back the pool through its 
getPooledConnection methods.
---
 .../org/apache/tomcat/jdbc/pool/PoolConfiguration.java     | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolConfiguration.java
 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolConfiguration.java
index 7f26fe7f2d..784a4f7a63 100644
--- 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolConfiguration.java
+++ 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolConfiguration.java
@@ -323,7 +323,7 @@ public interface PoolConfiguration {
      * The maximum number of connections that should be kept in the idle pool 
if {@link #isPoolSweeperEnabled()} returns
      * false. If {@link #isPoolSweeperEnabled()} returns true, then the idle 
pool can grow up to
      * {@link #getMaxActive} and will be shrunk according to {@link 
#getMinEvictableIdleTimeMillis()} setting. Default
-     * value is maxActive:100
+     * value is {@link #getMaxActive} (100 with the default configuration)
      *
      * @return the maximum number of idle connections.
      */
@@ -333,7 +333,7 @@ public interface PoolConfiguration {
      * The maximum number of connections that should be kept in the idle pool 
if {@link #isPoolSweeperEnabled()} returns
      * false. If {@link #isPoolSweeperEnabled()} returns true, then the idle 
pool can grow up to
      * {@link #getMaxActive} and will be shrunk according to {@link 
#getMinEvictableIdleTimeMillis()} setting. Default
-     * value is maxActive:100
+     * value is {@link #getMaxActive} (100 with the default configuration)
      *
      * @param maxIdle the maximum size of the idle pool
      */
@@ -944,7 +944,10 @@ public interface PoolConfiguration {
      * values are set, the method {@link 
javax.sql.DataSource#getConnection(String, String)} method will be called
      * instead of the {@link javax.sql.DataSource#getConnection()} method. If 
the data source implements
      * {@link javax.sql.XADataSource} the methods {@link 
javax.sql.XADataSource#getXAConnection()} and
-     * {@link javax.sql.XADataSource#getXAConnection(String,String)} will be 
invoked.
+     * {@link javax.sql.XADataSource#getXAConnection(String,String)} will be 
invoked. If it implements
+     * {@link javax.sql.ConnectionPoolDataSource} the methods
+     * {@link javax.sql.ConnectionPoolDataSource#getPooledConnection()} and
+     * {@link 
javax.sql.ConnectionPoolDataSource#getPooledConnection(String,String)} will be 
invoked instead.
      *
      * @param ds the {@link javax.sql.DataSource} to be used for creating 
connections to be pooled.
      */
@@ -954,8 +957,9 @@ public interface PoolConfiguration {
      * Returns a datasource, if one exists that is being used to create 
connections. This method will return null if the
      * pool is using a {@link java.sql.Driver}
      *
-     * @return the {@link javax.sql.DataSource} to be used for creating 
connections to be pooled or null if a Driver is
-     *             used.
+     * @return the backing object - a {@link javax.sql.DataSource}, {@link 
javax.sql.XADataSource} or
+     *             {@link javax.sql.ConnectionPoolDataSource} - used for 
creating connections to be pooled, or null if a
+     *             Driver is used.
      */
     Object getDataSource();
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to