#523 support slapi transactions
Closed: Fixed None Opened 7 years ago by rmeggins.

Extended operations have no way to group modify operations in a single transaction. We need to expose database transactions to the slapi layer e.g.

int
my_extop_plugin(pb)
{
...
slapi_txn_start();
slapi_modify_internal();
...
slapi_add_internal();
...
if (result == success) {
    slapi_txn_commit();
} else {
    slapi_txn_abort();
}

FYI. We exposed backend transaction as follows. So far, just memberof_fixup_task_thread uses it.

{{{
"slapi-plugin.h"
/
* Start database transaction

* \param pb Pblock which is supposed to set (Slapi_Backend
) to SLAPI_BACKEND
* \return 0 if successful
* \return Non-zero if an error occurred

* \see slapi_back_transaction_commit
* \see slapi_back_transaction_abort
/
int slapi_back_transaction_begin(Slapi_PBlock *pb);
/

* Commit database transaction

* \param pb Pblock which is used to start transaction
* \return 0 if successful
* \return Non-zero if an error occurred

* \see slapi_back_transaction_start
* \see slapi_back_transaction_abort
/
int slapi_back_transaction_commit(Slapi_PBlock
pb);
/
* Abort database transaction

* \param pb Pblock which is used to start transaction
* \return 0 if successful
* \return Non-zero if an error occurred

* \see slapi_back_transaction_commit
* \see slapi_back_transaction_abort
/
int slapi_back_transaction_abort(Slapi_PBlock
pb);

}}}

Metadata Update from @nhosoi:
- Issue assigned to rmeggins
- Issue set to the milestone: 1.3.0.a1

3 years ago

Login to comment on this ticket.

Metadata