Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [higgins-dev] JNDIContext close() does not close LDAP connections

Yes, but you have explained the reason behind it below.  So, I guess the
question that remains is, should we have a finalize method?  While it
is true that every JNDIContext leaves it's connection open to the LDAP
server for the reasons you describe , there should be no "leaking"
occurring because the underlying LDAP context will be closed when
the enclosing JNDIContext goes out of scope and is garbage collected.
In other words, we'd have to be "leaking" JNDIContexts.

We should discuss the conditions under which a finalize method would
be required.  I'm assuming it's one under which new contexts are always
created each time one is needed, never reused, and never go out of scope.
I'm not sure if we're in best practices territory or we need an API.  I'll
being Jim in on this too.

Tom

>>> Rajalakshmi S Iyer <iyer_rajalakshmi@xxxxxxxxxx> 08/23/08 10:28 AM >>> 
In the JNDI context provider, the JNDIContext's close() does not close the
underlying connection to the LDAP server; it simply sets a flag to state
that the context is closed. Is there any reason behind this or is this a
defect?

As I understand, the open() call establishes a connection as well as
performs authentication. A subsequent close and open with a different
credential object would only need to do a re- bind, without closing the
existing connection.

In order to avoid leaking connections to the LDAP server, should the
JNDIContext class implement a finalize() method that would close the LDAP
connection or should that be done in the close() method?

Comments?

Thanks,
Best regards,
Rajalakshmi Iyer

_______________________________________________
higgins- dev mailing list
higgins- dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/higgins- dev



Back to the top