pingidentity / ldapsdk

UnboundID LDAP SDK for Java
Other
326 stars 79 forks source link

transactions support in unboundid ldap #158

Open sherry442 opened 7 months ago

sherry442 commented 7 months ago

Hi,

Is unboundid ldap sdk has support for transaction handling? If yes, can you please explain from which version this is available.

Thanks & Regards, Sheriff

dirmgr commented 7 months ago

The LDAP SDK has support for standard LDAP transactions as described in RFC 5805, and this has been supported since 2010 when the RFC was made official. The Javadoc for the StartTransactionExtendedRequest class has an example that shows how to use it, but it consists of three main parts:

  1. Use the StartTransactionExtendedRequest to start a transaction in the server and get a transaction ID.
  2. Submit all of the write operations that are part of the transaction. Each of those requests should include a TransactionSpecificationRequestControl with the transaction ID obtained from the start transaction result.
  3. When you're ready, you can commit (or abort) the transaction with an EndTransactionExtendedRequest.

Note that this requires an LDAP server that provide support for standard LDAP transactions. The Ping Identity Directory Server definitely supports them. I believe that the most recent versions of OpenLDAP support them as well. I'm not sure about any other types of servers.

The Ping Identity Directory Server also supports a proprietary MultiUpdateExtendedRequest that allows you to submit all of the operations to process atomically in a single request so that you can avoid the multiple round trips required when using standard LDAP transactions.

gredwhite commented 7 months ago

The Ping Identity Directory Server also supports a proprietary [MultiUpdateExtendedRequest](https://docs.ldap.com/ldap-sdk/docs/javadoc/index.html?com/unboundid/ldap/sdk/unboundidds/extensions/MultiUpdateExtendedRequest.html) that allows you to submit all of the operations to process atomically in a single request so that you can avoid the multiple round trips required when using standard LDAP transactions.

Will it work with AD/Samba ?

dirmgr commented 7 months ago

As far as I'm aware, Active Directory does not have any support whatsoever for processing multiple operations as a single atomic unit.