You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Emmanuel Lecharny <el...@apache.org> on 2009/08/05 18:05:26 UTC

[Client-API] Should the unbind() operation close the connection ?

AFAICT, there is nowhere in the RFC a place where it's explicitely said 
that the Unbnd operation closes the connection.

Should we close the connection on the client side when doing a Unbond(), 
or keep it open ?

-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org



Re: [Client-API] Should the unbind() operation close the connection ?

Posted by Emmanuel Lecharny <el...@apache.org>.
Howard Chu wrote:
> Emmanuel Lecharny wrote:
>> AFAICT, there is nowhere in the RFC a place where it's explicitely said
>> that the Unbnd operation closes the connection.
>
> Huh?
>
> RFC4511 Section 4.3 Unbind Operation
>
>     The function of the Unbind operation is to terminate an LDAP session.
>
> That means "close the connection" ...
Not exactly in this paragraph, but it's clearly described in 
http://tools.ietf.org/html/rfc4511#section-5.3

So unbind definitively => disconnection.



-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org



Re: [Client-API] Should the unbind() operation close the connection ?

Posted by Howard Chu <hy...@symas.com>.
Emmanuel Lecharny wrote:
> AFAICT, there is nowhere in the RFC a place where it's explicitely said
> that the Unbnd operation closes the connection.

Huh?

RFC4511 Section 4.3 Unbind Operation

	The function of the Unbind operation is to terminate an LDAP session.

That means "close the connection" ...

> Should we close the connection on the client side when doing a Unbond(),
> or keep it open ?

-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/

Re: [Client-API] Should the unbind() operation close the connection ?

Posted by Emmanuel Lecharny <el...@apache.org>.
Quanah Gibson-Mount wrote:
>
>
> --On August 5, 2009 11:26:02 AM -0700 Howard Chu <hy...@symas.com> wrote:
>
>> Quanah Gibson-Mount wrote:
>>> AFAIK, it is perfectly valid to unbind and then rebind as a new user,
>>> without ever closing the connection, and without ever involving
>>> connection pooling.  This is why various LDAP api's, such as Net::LDAP,
>>> allow for the unbind operation as something separate than the close
>>> operation.
>>
>> Wrong.
>>
>> To rebind as a new user and keep the same connection, simply issue a new
>> Bind request. Unbind = Close.
>
> Eh, you're right.  I needed to refresh my Net::LDAP functions list. :P
Yep. What I found is that jLdap and ldapSdk are using disconnect() 
instead of unbind(), which is probably more meaningful.

-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org



Re: [Client-API] Should the unbind() operation close the connection ?

Posted by Quanah Gibson-Mount <qu...@zimbra.com>.

--On August 5, 2009 11:26:02 AM -0700 Howard Chu <hy...@symas.com> wrote:

> Quanah Gibson-Mount wrote:
>> AFAIK, it is perfectly valid to unbind and then rebind as a new user,
>> without ever closing the connection, and without ever involving
>> connection pooling.  This is why various LDAP api's, such as Net::LDAP,
>> allow for the unbind operation as something separate than the close
>> operation.
>
> Wrong.
>
> To rebind as a new user and keep the same connection, simply issue a new
> Bind request. Unbind = Close.

Eh, you're right.  I needed to refresh my Net::LDAP functions list. :P

--Quanah


--

Quanah Gibson-Mount
Principal Software Engineer
Zimbra, Inc
--------------------
Zimbra ::  the leader in open source messaging and collaboration

Re: [Client-API] Should the unbind() operation close the connection ?

Posted by Howard Chu <hy...@symas.com>.
Quanah Gibson-Mount wrote:
> AFAIK, it is perfectly valid to unbind and then rebind as a new user,
> without ever closing the connection, and without ever involving connection
> pooling.  This is why various LDAP api's, such as Net::LDAP, allow for the
> unbind operation as something separate than the close operation.

Wrong.

To rebind as a new user and keep the same connection, simply issue a new Bind 
request. Unbind = Close.
>
> --Quanah
>
> --On August 5, 2009 1:53:42 PM -0400 Alex Karasulu<ak...@gmail.com>
> wrote:
>
>> I think this is a matter of whether or not you are dealing with
>> connection pooling.
>>
>> Regards,
>> Alex
>>
>>
>> On Wed, Aug 5, 2009 at 12:05 PM, Emmanuel Lecharny<el...@apache.org>
>> wrote:
>>
>> AFAICT, there is nowhere in the RFC a place where it's explicitely said
>> that the Unbnd operation closes the connection.
>>
>> Should we close the connection on the client side when doing a Unbond(),
>> or keep it open ?
>>
>> --
>> --
>> cordialement, regards,
>> Emmanuel Lécharny
>> www.iktek.com
>> directory.apache.org

-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/

Re: [Client-API] Should the unbind() operation close the connection ?

Posted by Quanah Gibson-Mount <qu...@zimbra.com>.
AFAIK, it is perfectly valid to unbind and then rebind as a new user, 
without ever closing the connection, and without ever involving connection 
pooling.  This is why various LDAP api's, such as Net::LDAP, allow for the 
unbind operation as something separate than the close operation.

--Quanah

--On August 5, 2009 1:53:42 PM -0400 Alex Karasulu <ak...@gmail.com> 
wrote:

> I think this is a matter of whether or not you are dealing with
> connection pooling.
>
> Regards,
> Alex
>
>
> On Wed, Aug 5, 2009 at 12:05 PM, Emmanuel Lecharny <el...@apache.org>
> wrote:
>
> AFAICT, there is nowhere in the RFC a place where it's explicitely said
> that the Unbnd operation closes the connection.
>
> Should we close the connection on the client side when doing a Unbond(),
> or keep it open ?
>
> --
> --
> cordialement, regards,
> Emmanuel Lécharny
> www.iktek.com
> directory.apache.org
>
>
>
>
>
>
> --
> Alex Karasulu
> My Blog :: http://www.jroller.com/akarasulu/
> Apache Directory Server :: http://directory.apache.org
> Apache MINA :: http://mina.apache.org
>



--

Quanah Gibson-Mount
Principal Software Engineer
Zimbra, Inc
--------------------
Zimbra ::  the leader in open source messaging and collaboration

Re: [Client-API] Should the unbind() operation close the connection ?

Posted by Emmanuel Lecharny <el...@apache.org>.
Alex Karasulu wrote:
> I think this is a matter of whether or not you are dealing with connection
> pooling.
>   

After some RFC reading (thanks Kiran), the answer is : yes, on a 
standard connection.

http://tools.ietf.org/html/rfc4511#section-5.3

Now, connection pooling change the whole thing, you are right, Alex.

Maybe we should rename the operation to disconnect() (as LdapSDK/jLdap 
do) too...

-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org



Re: [Client-API] Should the unbind() operation close the connection ?

Posted by Alex Karasulu <ak...@gmail.com>.
I think this is a matter of whether or not you are dealing with connection
pooling.

Regards,
Alex

On Wed, Aug 5, 2009 at 12:05 PM, Emmanuel Lecharny <el...@apache.org>wrote:

> AFAICT, there is nowhere in the RFC a place where it's explicitely said
> that the Unbnd operation closes the connection.
>
> Should we close the connection on the client side when doing a Unbond(), or
> keep it open ?
>
> --
> --
> cordialement, regards,
> Emmanuel Lécharny
> www.iktek.com
> directory.apache.org
>
>
>


-- 
Alex Karasulu
My Blog :: http://www.jroller.com/akarasulu/
Apache Directory Server :: http://directory.apache.org
Apache MINA :: http://mina.apache.org