From 056af9934b22bd997489e4dc2ba28ad954f3d74f Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Mon, 16 Jan 2012 17:56:44 -0500 Subject: - if the entry being touched is in an ldbm back-end, but there's no transaction ID, just return, and have faith that we'll be called again in the transaction post --- src/back-shr.c | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) (limited to 'src/back-shr.c') diff --git a/src/back-shr.c b/src/back-shr.c index 31edfe9..111676f 100644 --- a/src/back-shr.c +++ b/src/back-shr.c @@ -888,6 +888,27 @@ backend_shr_update_references_cb(const char *group, const char *set, cbdata = cbdata_ptr; state = set_data->state; +#ifdef USE_SLAPI_BE_TXNS + /* If the backend type is "ldbm database" and we have no transaction, + * do nothing, because we'll be called again later post-transaction, + * and we'll deal with it then. */ + if (cbdata->pb != NULL) { + void *txn; + char *be_type; + txn = NULL; + be_type = NULL; +#ifdef SLAPI_TXN + slapi_pblock_get(cbdata->pb, SLAPI_TXN, &txn); +#endif +#ifdef SLAPI_TXN + slapi_pblock_get(cbdata->pb, SLAPI_BE_TYPE, &be_type); +#endif + if ((txn == NULL) && (strcmp(be_type, "ldbm database") == 0)) { + return 0; + } + } +#endif + /* If the entry didn't change any attributes which are at all relevant * to this map, then we don't need to recompute anything. */ if (set_data->skip_uninteresting_updates && @@ -1501,6 +1522,27 @@ backend_shr_add_cb(Slapi_PBlock *pb) return 0; } +#ifdef USE_SLAPI_BE_TXNS + /* If the backend type is "ldbm database" and we have no transaction, + * do nothing, because we'll be called again later post-transaction, + * and we'll deal with it then. */ + if (pb != NULL) { + void *txn; + char *be_type; + txn = NULL; + be_type = NULL; +#ifdef SLAPI_TXN + slapi_pblock_get(pb, SLAPI_TXN, &txn); +#endif +#ifdef SLAPI_TXN + slapi_pblock_get(pb, SLAPI_BE_TYPE, &be_type); +#endif + if ((txn == NULL) && (strcmp(be_type, "ldbm database") == 0)) { + return 0; + } + } +#endif + /* Read parameters from the pblock. */ slapi_pblock_get(pb, SLAPI_PLUGIN_PRIVATE, &cbdata.state); if (cbdata.state->plugin_base == NULL) { @@ -1654,6 +1696,27 @@ backend_shr_modify_cb(Slapi_PBlock *pb) return 0; } +#ifdef USE_SLAPI_BE_TXNS + /* If the backend type is "ldbm database" and we have no transaction, + * do nothing, because we'll be called again later post-transaction, + * and we'll deal with it then. */ + if (pb != NULL) { + void *txn; + char *be_type; + txn = NULL; + be_type = NULL; +#ifdef SLAPI_TXN + slapi_pblock_get(pb, SLAPI_TXN, &txn); +#endif +#ifdef SLAPI_TXN + slapi_pblock_get(pb, SLAPI_BE_TYPE, &be_type); +#endif + if ((txn == NULL) && (strcmp(be_type, "ldbm database") == 0)) { + return 0; + } + } +#endif + /* Read parameters from the pblock. */ slapi_pblock_get(pb, SLAPI_PLUGIN_PRIVATE, &cbdata.state); if (cbdata.state->plugin_base == NULL) { @@ -1798,6 +1861,27 @@ backend_shr_modrdn_cb(Slapi_PBlock *pb) return 0; } +#ifdef USE_SLAPI_BE_TXNS + /* If the backend type is "ldbm database" and we have no transaction, + * do nothing, because we'll be called again later post-transaction, + * and we'll deal with it then. */ + if (pb != NULL) { + void *txn; + char *be_type; + txn = NULL; + be_type = NULL; +#ifdef SLAPI_TXN + slapi_pblock_get(pb, SLAPI_TXN, &txn); +#endif +#ifdef SLAPI_TXN + slapi_pblock_get(pb, SLAPI_BE_TYPE, &be_type); +#endif + if ((txn == NULL) && (strcmp(be_type, "ldbm database") == 0)) { + return 0; + } + } +#endif + /* Read parameters from the pblock. */ slapi_pblock_get(pb, SLAPI_PLUGIN_PRIVATE, &cbdata.state); if (cbdata.state->plugin_base == NULL) { @@ -1909,6 +1993,27 @@ backend_shr_delete_cb(Slapi_PBlock *pb) return 0; } +#ifdef USE_SLAPI_BE_TXNS + /* If the backend type is "ldbm database" and we have no transaction, + * do nothing, because we'll be called again later post-transaction, + * and we'll deal with it then. */ + if (pb != NULL) { + void *txn; + char *be_type; + txn = NULL; + be_type = NULL; +#ifdef SLAPI_TXN + slapi_pblock_get(pb, SLAPI_TXN, &txn); +#endif +#ifdef SLAPI_TXN + slapi_pblock_get(pb, SLAPI_BE_TYPE, &be_type); +#endif + if ((txn == NULL) && (strcmp(be_type, "ldbm database") == 0)) { + return 0; + } + } +#endif + /* Read parameters from the pblock. */ slapi_pblock_get(pb, SLAPI_PLUGIN_PRIVATE, &cbdata.state); if (cbdata.state->plugin_base == NULL) { -- cgit