Reputation: 15876
<Resource name="myConn" auth="Container"
type="javax.sql.DataSource" driverClassName="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:@10.10.10.10.:1521:mydb"
username="username" password="password" maxActive="500" maxIdle="50"
maxWait="-1" removeAbandoned="true" removeAbandonedTimeout="60" logAbandoned="true" accessToUnderlyingConnectionAllowed="true"
/>
I am trying to find out areas of the application where connections are NOT being closed. I added the removeAbandoned and logAbandoned clauses in my context file but if i check v$session on oracle it is still showing the same number of connections active even after 60 seconds. Is there something wrong in the configuration above?
Upvotes: 3
Views: 7200
Reputation: 26532
I would set maxActive
to smaller value like 50 and then check if the configuration is working correctly.
According to the docs the connections pool must running low to execute the check for abandoned connections:
When available db connections run low DBCP will recover and recycle any abandoned dB connections it finds.
I would also changed the removeAbandonedTimeout
to 20 so that you won't have to wait to long to check if the detector is working fine.
Upvotes: 2