https://issues.apache.org/bugzilla/show_bug.cgi?id=50333

           Summary: IllegalArgumentException occurs when setting maxActive
                    to smaller than 1.
           Product: Tomcat Modules
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: jdbc-pool
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: mashm...@gmail.com


Created an attachment (id=26340)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26340)
patch

IllegalArgumentException occurs when setting maxActive to smaller than 1.

-----
java.lang.IllegalArgumentException
        at
java.util.concurrent.ArrayBlockingQueue.<init>(ArrayBlockingQueue.java:164)
        at
org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:365)
        at
org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:130)
        at
org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:93)
        at
org.apache.tomcat.jdbc.pool.DataSourceFactory.createDataSource(DataSourceFactory.java:490)
        at
org.apache.tomcat.jdbc.pool.DataSourceFactory.getObjectInstance(DataSourceFactory.java:219)
        at
org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:142)
        at
javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:826)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:145)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:814)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:159)
        at
org.apache.catalina.core.NamingContextListener.addResource(NamingContextListener.java:1020)
        at
org.apache.catalina.core.NamingContextListener.createNamingContext(NamingContextListener.java:631)
        at
org.apache.catalina.core.NamingContextListener.lifecycleEvent(NamingContextListener.java:237)
        at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
        at
org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:668)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:596)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:303)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:431)
---

In DBCP, if the negative value is set to maxActive, the pool size is unlimited.
However, because ArrayBlockingQueue is used in JDBC-Pool, values that are
smaller than 1 cannot be set to maxActive.  

In my patch, if maxActive is smaller than 1, default value (100) is set to
maxActive. 

Regards.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to