| Author |
Connection pool - running out of connections
|
hamid hussain
Greenhorn
Joined: Aug 10, 2005
Posts: 2
|
|
hi, We are using JConnect 5 and JDK 1.5 in our application. We use connection pool to get the connection and close the connection after using it by con.close(). But appraently the connections are not getting closed and we can see lots of DB connections in the syabse server. Due to this we are running out of user connections on syabse server. Can someone let me know what could be wrong. We are using Adaptive Server Enterprise/12.0. The same code was working fine with JDK 1.3.1. Thanks Hamid
|
 |
Roger Chung-Wee
Ranch Hand
Joined: Sep 29, 2002
Posts: 1683
|
|
You must do these things in your method. 1. Use a local variable for your Connection. 2. Ensure that your JDBC objects are closed in the finally block. 3. Handle each close by closing the ResultSet, Statement and Connection in their own try/catch block.
|
SCJP 1.4, SCWCD 1.3, SCBCD 1.3
|
 |
hamid hussain
Greenhorn
Joined: Aug 10, 2005
Posts: 2
|
|
hi, this piece of code was working fine with JDK 1.3.1 and we are closing the DB objects. Only when we recently migrated to JDK1.5 did this issue come up. Regards Hamid
|
 |
 |
|
|
subject: Connection pool - running out of connections
|
|
|