|
Question : JDBC Open Connections keep growing
|
|
We have an application that keeps crashing its OC4J instance.
I believe it to be due to the fact that the OC4J's Open JDBC connections keep growing until it it gets to about 400 open connections. It seems like it never kills that many open connections. 1 or two connections may be closed every few minutes, but over time, the number just keep steadily growing.
The connections used to grow to 1000 or so, but our DBA write a script on our DB server to kill idle connections every few hours. It has helped a little, but has not remedied our situation.
I currently do not have JDBC connection pooling enabled (I have DB caching enabled though).
Should I look at the application server config, database server, or j2ee code to see what is the cause of this?
Would connection pooling help with this situation?
This install is a standalone j2ee and webcache installation with no intfrastructure.
|
Answer : JDBC Open Connections keep growing
|
|
I was looking around and found this post. Does this relate to your problem ?
The solution is to modify the configuration in the parameters for the pooling in order to define a disconnection after some time for all application modules.
Add the following parameters in the OC4J Instance's Java Options section -Djbo.maxpoolsize=0 -Djbo.ampool.maxinactiveage=150000 -Djbo.ampool.maxavailablesize=0 -Djbo.ampool.minavailablesize=0 -Djbo.ampool.monitorsleepinterval=150000
The meaning for these parameters are as follows:
-Djbo.maxpoolsize=0
The connection pooling is disabled with this option. So when a AM is closed the connection to the database is also closed.
-Djbo.ampool.maxinactiveage=150000
The time that a AM can be idle is 2.5 minutes. If an AM is idle more than 2.5 minutes it is released. So the connection to the database is also closed.
-Djbo.ampool.maxavailablesize=0
The max number of AM available IDLE is zero. This will close the AM and then the corresponding connections to the database.
-Djbo.ampool.minavailablesize=0
The min available of AM is zero.This will keep zero as initial AM. and there not will be connections open to the database until a new AM is created.
-Djbo.ampool.monitorsleepinterval=150000
This is the interval that the monitor will be sleep for the next round.
|
|
|
|