logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Lemke <scott.r.le...@gmail.com>
Subject Connection leak with JDBCAppender
Date Fri, 26 Jul 2013 18:23:23 GMT
Hello,

I'm working on using the JDBCAppender and am seeing a leaked connection.
I'm using Glassfish 3.1 with Jersey and Oracle using a JNDI connection for
log4j.
In my test app just doing a single log will reach the database fine, but
then I get the leaked
connection warning from Glassfish for the pool.

Looking at the code, and please correct me where I am wrong as I'm just now
getting into it,
it looks like that after JDBCDatabaseManager.writeInternal() the statement
doesn't get closed,
nor the connection, as JDBCDatabaseManager.disconnectInternal() isn't
called until the appender
is stopped or the manager is replaced, leaving both open for a potentially
long time.

I can see arguments on both sides of leaving them open vs closing after
each insert,
or doing a mix of both allowing for a configurable close time. But my
question is,
is this intended behavior? If so, I could turn off leak detection.

Scott Lemke

-- 
"The only thing necessary for the triumph of evil is for good men to do
nothing" --Edmund Burke

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message