https://bz.apache.org/bugzilla/show_bug.cgi?id=64107

            Bug ID: 64107
           Summary: PreparedStatements correctly closed are not returning
                    to pool. Leads to PreparedStatement Pool exhaustion.
           Product: Tomcat Modules
           Version: unspecified
          Hardware: PC
            Status: NEW
          Severity: major
          Priority: P2
         Component: jdbc-pool
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

In our code there is a sql statement that is fired multiple times with
different input values. The datasource is configured to use pooling of prepared
statements. The pool runs out of available preparedstatements with even single
user. Below is the error that is thrown.

Cause:
java.util.NoSuchElementException: Pool exhausted
java.sql.SQLException: MaxOpenPreparedStatements limit reached


The statements are being closed correctly and as per documentation should
return to the pool available for next sql execution.

Below is the jdbc resource definition. 

<Resource auth="Container"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
type="javax.sql.DataSource"
name="jdbc/SomeDataSourceName" password="<password>" username="<username>"
url="<dburl>"
maxTotal="10" initialSize="5" maxIdle="8" minIdle="0" maxWaitMillis="5000"
poolPreparedStatements="true"
maxOpenPreparedStatements="150" testOnBorrow="false" testWhileIdle="true"
validationQuery="select 1"
timeBetweenEvictionRunsMillis="900000" removeAbandonedTimeout="180"
removeAbandonedOnBorrow="true"
removeAbandonedOnMaintenance="true" logAbandoned="false"
minEvictableIdleTimeMillis="1800000" />

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to