1 message in com.mysql.lists.mysqlStatement release
FromSent OnAttachments
Filip Rachunek22 Feb 2006 23:06 
Subject:Statement release
From:Filip Rachunek (fili@gmail.com)
Date:02/22/2006 11:06:21 PM
List:com.mysql.lists.mysql

Hello,

I would like to solve this problem. I get a Connection instance from a connection pool, create some statements and prepared statements, do some database operations, close all statements and return the connection to the pool. My question is, are the statements released (garbage collected) after calling Statement.close() or is it necessary to set them to null? I would like to avoid a possible memory leak because the connection is not physically closed, only returned to the pool to be reused later. The second question is - if a statement is not properly closed due to an exception thrown before the .close() method is called, could it cause a memory leak as well? I use the latest Connector of the 3.1.x branch and MySQL 4.1.x.

Filip