summaryrefslogtreecommitdiff
path: root/lib/tdb/include
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronniesahlberg@gmail.com>2009-05-25 17:04:42 +1000
committerStefan Metzmacher <metze@samba.org>2009-11-20 09:45:34 +0100
commit436b55db1ff238ec467b07a74b088f6fcfaf927c (patch)
tree1689f28b11031276ec4b9ce95509e5a780de4c9a /lib/tdb/include
parent85449b7bcc4bd7948bea38b5514a02357950a002 (diff)
downloadsamba-436b55db1ff238ec467b07a74b088f6fcfaf927c.tar.gz
samba-436b55db1ff238ec467b07a74b088f6fcfaf927c.tar.bz2
samba-436b55db1ff238ec467b07a74b088f6fcfaf927c.zip
New attempt at TDB transaction nesting allow/disallow.
Make the default be that transaction is not allowed and any attempt to create a nested transaction will fail with TDB_ERR_NESTING. If an application can cope with transaction nesting and the implicit semantics of tdb_transaction_commit(), it can enable transaction nesting by using the TDB_ALLOW_NESTING flag. (cherry picked from ctdb commit 3e49e41c21eb8c53084aa8cc7fd3557bdd8eb7b6) Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'lib/tdb/include')
-rw-r--r--lib/tdb/include/tdb.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/tdb/include/tdb.h b/lib/tdb/include/tdb.h
index e849f20641..5cc1eecdd1 100644
--- a/lib/tdb/include/tdb.h
+++ b/lib/tdb/include/tdb.h
@@ -48,11 +48,13 @@ extern "C" {
#define TDB_NOSYNC 64 /* don't use synchronous transactions */
#define TDB_SEQNUM 128 /* maintain a sequence number */
#define TDB_VOLATILE 256 /* Activate the per-hashchain freelist, default 5 */
+#define TDB_ALLOW_NESTING 512 /* Allow transactions to nest */
/* error codes */
enum TDB_ERROR {TDB_SUCCESS=0, TDB_ERR_CORRUPT, TDB_ERR_IO, TDB_ERR_LOCK,
TDB_ERR_OOM, TDB_ERR_EXISTS, TDB_ERR_NOLOCK, TDB_ERR_LOCK_TIMEOUT,
- TDB_ERR_NOEXIST, TDB_ERR_EINVAL, TDB_ERR_RDONLY};
+ TDB_ERR_NOEXIST, TDB_ERR_EINVAL, TDB_ERR_RDONLY,
+ TDB_ERR_NESTING};
/* debugging uses one of the following levels */
enum tdb_debug_level {TDB_DEBUG_FATAL = 0, TDB_DEBUG_ERROR,