Synchronous Operation


LDAP is an inherently asynchronous protocol, meaning that, in most cases, you can issue multiple concurrent requests over the same connection and the client will be able to correlate the responses with their appropriate requests.

Most of the JAVA LDAP SDKs and other LDAP API function calls have both Synchronous Operation and Asynchronous Operation versions.

A Synchronous Operation LDAP Request call must return and provide a LDAP Result Code before your client can continue executing code.

This is in contrast to Asynchronous Operations which return a Message ID and NOT a LDAP Result Code.

Synchronous Operation function calls, are typically identified by an -s or _s suffix in the function name. (In "c" SDKs)

Synchronous Operation can be used when an application using the LDAP does not need to perform Asynchronous Operations, and if it does not attempt to process multiple operations on the same connection at the same time, then you can use the Synchronous Operation.

Synchronous Operation may achieve a significant increase in throughput and reduction in response time. In our testing, we have generally seen a performance improvement of about 15-20% by enabling the option to use Synchronous Operation.

You should always use Synchronous Operations when using LDAP Connection Pools for reasons as stated above.

The LDAP protocol specification (RFC 4511 section 4.2.1) states that bind operations cannot be processed on a connection that has any other outstanding operations.

Bind Request and Bind Response must be Synchronous Operation#

In particular "Before processing a Bind Request, all uncompleted operations MUST either complete or be abandoned" and "After sending a Bind Request, clients MUST NOT send further LDAP PDUs until receiving the Bind Response."

This is because a bind operation is used to change the authentication state of a connection (and in some cases may also include negotiating a communication security layer). It is dangerous to have other types of operations in progress on the connection while a Bind Request is being processed because the bind processing may change the nature of the response to the client.

More Information#

There might be more information for this subject on one of the following: