return ret;
}
}
+
+ data->in_transaction++;
+
return LDB_SUCCESS;
}
}
}
+ if (data->in_transaction == 0) {
+ DEBUG(0,("partition end transaction mismatch\n"));
+ return LDB_ERR_OPERATIONS_ERROR;
+ }
+ data->in_transaction--;
+
return ldb_next_end_trans(module);
}
}
}
+ if (data->in_transaction == 0) {
+ DEBUG(0,("partition del transaction mismatch\n"));
+ return LDB_ERR_OPERATIONS_ERROR;
+ }
+ data->in_transaction--;
+
ret = ldb_next_del_trans(module);
if (ret != LDB_SUCCESS) {
final_ret = ret;
talloc_steal((*partition), (*partition)->module);
+ /* if we were in a transaction then we need to start a
+ transaction on this new partition, otherwise we'll get a
+ transaction mismatch when we end the transaction */
+ if (data->in_transaction) {
+ struct ldb_module *next = (*partition)->module;
+ PARTITION_FIND_OP(next, start_transaction);
+
+ ret = next->ops->start_transaction(next);
+ }
+
return ret;
}
if (ret != LDB_SUCCESS) {
return ret;
}
-
- /* Start a transaction on the DB (as it won't be in one being brand new) */
- {
- struct ldb_module *next = partition->module;
- PARTITION_FIND_OP(next, start_transaction);
-
- ret = next->ops->start_transaction(next);
- if (ret != LDB_SUCCESS) {
- return ret;
- }
- }
}
ret = new_partition_set_replicated_metadata(ldb, module, last_req, data, partition);