Delay in the release of connections to pool after closing.

Hi,

I'm using typical jdbc code to close the Connections got through ConnectionPool created on Weblogic 8.1. When the data access / update code is completed execution, I could observe couple of connections still open in the weblogic console connections monitor screen.

These open connections are getting released after 15 minutes approximately, provided if I'm not accessing any DB access/update code till then.

I'm using the following code for closing all the jdbc resources.

publicstaticvoid closeAllResources(){

try{

if (rSet !=null){

rSet.close();

rSet =null;

}

if (rSet2 !=null){

rSet2.close();

rSet2 =null;

}

if (preStatement !=null){

preStatement.close();

preStatement =null;

}

if (callStatement !=null){

callStatement.close();

callStatement =null;

}

if (conn !=null){

conn.close();

conn =null;

}

}

catch (SQLException e){

}

}

I'm closing the jdbc resources as follows in finally block...

publicstaticboolean saveXXX(String userid, ArrayList list)throws SQLException{

BaseDAO baseDAO =null;

String scode=null;

try{

baseDAO =new BaseDAO();

conn = baseDAO.getConnection();callStatement = baseDAO.prepareCallableStatement("call pkg_1.pr_add_XXX(?,?)");

callStatement.setObject(1, userid);

callStatement.setObject(2, scode);

int saveResult = callStatement.executeUpdate();

}

finally{

closeAllResources();

}

returntrue;

}

}

}

Both the above methods are present in the same java class.

Can sombody help me in resolving the issue immediately?

Regards

Sudarsan

[3507 byte] By [RNSudarshana] at [2007-10-3 7:45:01]
# 1

Do you understand what a connection pool is and how it works at all?

It is a pool of open connections. It therefore perfectly fine and appropriate for their to be open connections from your pool to your database once you have returned them to the pool. These connections will be kept alive for a period of time (in your case apparently 15 minutes) to serve the next request for a connection from the pool.

This is really the whole point of using a connection pool. Reuse.

cotton.ma at 2007-7-15 2:46:20 > top of Java-index,Java Essentials,Java Programming...