directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <>
Subject Re: A question regarding "" class
Date Wed, 10 Mar 2010 18:26:01 GMT
On 3/10/10 4:03 PM, Michal Lefler wrote:
> Hi.
> I was using JNDI, and I noticed that if I use JNDI connection pooling,
> "ctx.close()" does not release the context back to the pool unless I
> execute "System.gc()" explicitly.
There are two things that are not obvious when using a JNDI connection 
object :
- You have to close the connections when you are done with them (seems 
like you are)
- and you also *have* to close all the NamingEnumeration you are using, 
especially if you don't grab all the elements it returns, as it won't 
let you close the connection if the NamingEnumeration is not closed.

The second point is really annoying, and will lead you to the kind of 
problem you have. I would bet more on such a problem than a issue with 
the garbage collector...

Emmanuel L├ęcharny

View raw message