diff options
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/partition_init.c')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/partition_init.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/partition_init.c b/source4/dsdb/samdb/ldb_modules/partition_init.c index 28eab9b2ee..5967bc8159 100644 --- a/source4/dsdb/samdb/ldb_modules/partition_init.c +++ b/source4/dsdb/samdb/ldb_modules/partition_init.c @@ -282,6 +282,16 @@ static int new_partition_from_dn(struct ldb_context *ldb, struct partition_priva 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; } @@ -698,17 +708,6 @@ int partition_create(struct ldb_module *module, struct ldb_request *req) 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); |