0
votes

I have a Java web application, that uses Apache DBCP to connect to an Oracle DB. The connection is done using JNDI. In my application, I need to run a a query to the database, process the results and then save the updates.
The problem is that no matter what properties I set for the db connection parameters (maxWait, minEvictableIdleTimeMillis, testOnBorrow, etc - I have tried all of them with different values), I always receive back a "connection closed" error, after aprox. 2.5 min. The result set I process is large, and the execution takes longer than 2.5 mins, but even if I do the paginated query, to hit the database often, I still get the same error. Another strange thing is that, no matter what value I set for the connection pool size (with maxActive, maxIdle, initialSize), if I log the max physical open connections the value is 1. Do you have any idea why this happens? Could this be caused by a setting on DB / network side?

1

1 Answers

0
votes

This can happen due to multiple issues.

1) All the changes that you have made are on client side. You should probably look in other areas too. 2) Check oracle/server side setting's such as sqlnet.ora and maximum number of connections/session and processes allowed at the database level. 3) Check if there are any soft/hard firewall settings that are closing your session/connection. This may be the reason for your "connection closed".

Thanks Rahul