package ocamldap

  1. Overview
  2. Docs
type txn

the abstract type of a transaction

exception Txn_commit_failure of string * exn * Ldap_ooclient.ldapentry_t list option

raised when a commit fails, contains a list of entries which were not rolled back successfully only if rollback failed as well, otherwise None

exception Txn_rollback_failure of string * exn

raised when an explicit rollback fails

class ldapadvisorytxcon : ?connect_timeout:int -> ?referral_policy:[> `RETURN ] -> ?version: int -> string list -> string -> string -> string -> object ... end

A subclass of ldapcon which implements an experimental interface to draft_zeilenga_ldap_txn. A draft standard for multi object transactions over the ldap protocol. This class can only implement advisory transactions because it must depend on the advisory locking mechanisms for the transactions to be consistant. You use this class by calling begin_txn to get a transaction id, and then associating a set of ldapentry objects with the transaction by calling associate_entry_with_txn. You are then free to modify those entries in any way you like, and when you are done, you can either call commit_txn, or rollback_txn. Commit will commit the changes of all the entries associated with the transaction to the database. For other writers which obey advisory locking the commit operation is atomic. For readers which are willing to obey advisory locking is atomic. If the commit fails, a full rollback occurrs, including all changes made to the directory. For example in a set of N entries in a transaction, if the modificiation of the nth entry fails to commit, then the modifications to all the previous entries, which have already been made in the directory, are undone. It is important to note that if advisory locking is not obeyed, rollback may not be successful. Rollback undoes all the changes you've made in memory, and unlocks all the objects in the transaction. After a transaction object has been commited or rolled back it is considered "dead", and cannot be used again.

OCaml

Innovation. Community. Security.