Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

not closing invalid connections in DB connection pool using tomcat DBCP with JDBC

leave_forMay 28 2024

Hi,

I am faced with a situation that is not closed invalid connections in DB connection pool using tomcat DBCP with JDBC.

Our system has dbcp related settings like below with context.xml at the tomcat.

--

<Resource name="jdbc/…JNDI" …type="javax.sql.DataSource"…validationQuery="SELECT 1 from dual" maxWaitMillis="10000" maxTotal="30 initialSize="30" minIdle="30" testOnBorrow="true" />

--

Now there are over 200 connections. We checked with the "$ netstat -p | grep {PID of the PORT}" command.

After restarting tomcat, the number of connections is 30.

However, there is something special.

Although we have set up dbcp, our system does not connect to the db at all.

I am wondering if the situation above might be a bug.

The problem can be easily solved by deleting the dbcp setting, but before proceeding, I have a need to check whether this phenomenon is a bug or not.

I would be really happy if you could give me an answer. Thank you.

Comments
Post Details
Added on May 28 2024
0 comments
487 views