Not sure if it matters or not, but in your   SponserSummaryDAO method, it 
appears you establish the rs as null, but don't ever close it? You might 
specifically try that.

And is it necessary to reassign all those variables (connection, rs, pstmt) to 
null again in those catch blocks?


-----Original Message-----
From: sasidhar prabhakar [mailto:sasidhar1...@gmail.com]
Sent: Thursday, November 04, 2010 7:05 AM
To: Tomcat Users List
Subject: Re: DBCP abandoned trace - unable to understand the leak

*
* @author oracle
*/
public class SponserSummaryDAO {
...


public SponserSummaryDAO(){
log.info("^^^^^Cretion of SponserSummaryDAO :
"+Calendar.getInstance().getTime().toString());
dataSource = ConnectionUtil.getDataSource(); }

public void updateClicks(int sid){
Connection connection = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
try{
connection = dataSource.getConnection();

pstmt = connection.prepareStatement(updateClicksQuery);
pstmt.setInt(1, sid );
int updated = pstmt.executeUpdate();
log.info(" sponser clicks updated val : "+updated); }catch(Exception ex){ 
ex.printStackTrace(); log.error(ex.getMessage()); }finally{ try {if( pstmt != 
null)pstmt.close();} catch (SQLException ex) {ex.printStackTrace();} try {if( 
connection != null)connection.close();} catch (SQLException ex) 
{ex.printStackTrace();} connection = null; pstmt = null; } }

}

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to