From c03d5c5740f9d1894a971110029e8f567d300d8a Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 11 Jan 2013 15:32:39 +0100 Subject: [PATCH] dbwrap: Prevent transactions on non-persistent dbs dbwrap_ctdb does not allow this anyway. This patch will avoid suprises when going non-clustered to clustered. Not everybody is developing against a clustered environment :-) Signed-off-by: Volker Lendecke Reviewed-by: Stefan Metzmacher --- lib/dbwrap/dbwrap.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/dbwrap/dbwrap.c b/lib/dbwrap/dbwrap.c index 15eb239c358..f0b7a9a3ac5 100644 --- a/lib/dbwrap/dbwrap.c +++ b/lib/dbwrap/dbwrap.c @@ -452,6 +452,11 @@ int dbwrap_get_seqnum(struct db_context *db) int dbwrap_transaction_start(struct db_context *db) { + if (!db->persistent) { + DEBUG(1, ("transactions not supported on non-persistent " + "database %s\n", db->name)); + return -1; + } return db->transaction_start(db); } -- 2.11.4.GIT