users@glassfish.java.net

Augh! Best practices on FINDING a connection leak?

From: Joseph B. Ottinger <joeo_at_enigmastation.com>
Date: Tue, 2 May 2006 20:17:40 -0400 (EDT)

Yes, I'm back. I'm still suffering from my connection leak with JMS, and
I'm not sure where or why; everywhere a session was used, the session goes
out of scope (although the ConnectionFactory doesn't, as it's injected via
@Resource). I've explicitly added close()s for the producer, session,
connection, but I have little confidence that this will actually fix
things.

I'm of the (admittedly shaky) opinion that I'm not purposefully holding on
to resources. (Again, I'm not allocating them; they're injected.) It's
possible that I'm participating in transactions that last a while (message
-> MDB which uses a DAO and potentially sends another message or set of
them...) and things are getting hung up there, but the data IS getting
committed.

So... what's the best way for me to find out where a connection is being
allocated and deallocated? I don't have a problem wading through a lot of
logs, if I'm confident that the data can be there.

-----------------------------------------------------------------------
Joseph B. Ottinger http://enigmastation.com
Editor, http://www.TheServerSide.com joeo@enigmastation.com