Chapter 65. Parameters for LDBM Back End Transaction Pre- and Post-Operation Functions

The section describes the parameters that the LDBM back end transaction plug-in functions use:
These functions are called inside the database transaction and perform atomic operations. For example, if an error occurs during a pre- or post-operation, you can revert the complete database transaction.
An updated operation, that is performed inside of a transaction plug-in, runs as a child transaction of the enclosing parent transaction. This means:
  • The plug-in uses data that other child transactions of the parent transaction already committed. For example:
    • A modify operation can use data that another child transaction of the enclosing parent transaction modified and committed.
    • A search operation returns data that another child transaction of the enclosing parent transaction modified and committed.
  • If the plug-in writes to the database, but a subsequent operation fails in the same enclosing parent transaction, the plug-in's write operation is removed. Any aborted transaction at any child level is reverted up to the original update operation's transaction.
To correctly abort the changes in case of an error, plug-ins using the pre- or post-operation transaction type must return a non-zero value if the plug-in operation failed. In case of an error, Red Hat recommended to additionally set the result code (SALPI_RESULT_CODE) or the return code opreturn (SLAPI_PLUGIN_OPRETURN) in the pblock parameter.
Due to the nature of the LDBM database, deadlocks can occur in database operations. Other database errors cause the transaction to abort and to return the error. However, in case of a deadlock the operation is retried up to 50 times. The back end transaction pre- and post-plug-ins are called as many times as the retry is attempted, while the back end pre- and post-plug-ins are not.

65.1. Pre-Operation Plug-ins

The parameters listed in this section are used with back end transaction pre-operation database plug-in functions.
Parameter IDDescription
SLAPI_PLUGIN_BE_TXN_PRE_ADD_FN This function is called in a database transaction before a database add operation is completed.
SLAPI_PLUGIN_BE_TXN_PRE_DELETE_FN This function is called in a database transaction before a database delete operation is completed.
SLAPI_PLUGIN_BE_TXN_PRE_MODIFY_FN This function is called in a database transaction before a database modify operation is completed.
SLAPI_PLUGIN_BE_TXN_PRE_MODRDN_FN This function is called in a database transaction before a database modify RDN operation is completed.