summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/ldb_tdb/ldb_tdb.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2009-02-22 01:50:49 -0500
committerSimo Sorce <idra@samba.org>2009-02-23 13:33:19 -0500
commit689b8f5bb36a003756ee41787487237eef48cfab (patch)
tree0c14c96db6bf2807ddea01c7ba325a0797e83fdf /source4/lib/ldb/ldb_tdb/ldb_tdb.c
parentfda0158c14b97a54a911bb87ffc0ebb7c5729138 (diff)
downloadsamba-689b8f5bb36a003756ee41787487237eef48cfab.tar.gz
samba-689b8f5bb36a003756ee41787487237eef48cfab.tar.bz2
samba-689b8f5bb36a003756ee41787487237eef48cfab.zip
Make all transactions nested in ldb. The current samba4 code expects this
behavior anyway, and given we can only have one transaction active per ldb context this is the only sane model we can support. Fix ldb_tdb transactions, we could return back with an error with neither committing nor canceling the actual tdb transaction in some error paths within the ltdb commit and cancel transaction paths. Added also some debugging to trace what was going on.
Diffstat (limited to 'source4/lib/ldb/ldb_tdb/ldb_tdb.c')
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_tdb.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_tdb.c b/source4/lib/ldb/ldb_tdb/ldb_tdb.c
index d6276c4b86..24ec06ea32 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_tdb.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_tdb.c
@@ -865,6 +865,7 @@ static int ltdb_end_trans(struct ldb_module *module)
ltdb->in_transaction--;
if (ltdb_index_transaction_commit(module) != 0) {
+ tdb_transaction_cancel(ltdb->tdb);
return ltdb_err_map(tdb_error(ltdb->tdb));
}
@@ -883,6 +884,7 @@ static int ltdb_del_trans(struct ldb_module *module)
ltdb->in_transaction--;
if (ltdb_index_transaction_cancel(module) != 0) {
+ tdb_transaction_cancel(ltdb->tdb);
return ltdb_err_map(tdb_error(ltdb->tdb));
}