G'day,
I was browsing though JDBCMailRepository.java, and noticed in many of the
methods (store, retrieve, remove, list), a JDBC connection is obtained,
but in the event of an exception being thrown, the connection isn't closed
in the catch() block, which will result in a connection leak, since
connection.close() isn't called, although the connection object be garbage
collected of course.
The code should be refactored to have a finally() block so that the code
looks like:
method()
{
try
{
Connection c = getConnection();
...
}
catch (Exception e)
{
...
}
finally
{
c.close();
}
}
--
Cheers,
David
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]