s4:ldb Provide bindings for ldb_transaction_prepare_commit()
authorAndrew Bartlett <abartlet@samba.org>
Thu, 26 Nov 2009 04:32:06 +0000 (15:32 +1100)
committerAndrew Tridgell <tridge@samba.org>
Fri, 27 Nov 2009 05:05:04 +0000 (16:05 +1100)
source4/lib/ldb/pyldb.c

index 0d1d2fa9668e28c99f8e9fa8256b962e0d5420b4..0ba69e1c4845cf2a8488d1d778fa86c5f6b7204a 100644 (file)
@@ -477,6 +477,12 @@ static PyObject *py_ldb_transaction_commit(PyLdbObject *self)
        Py_RETURN_NONE;
 }
 
+static PyObject *py_ldb_transaction_prepare_commit(PyLdbObject *self)
+{
+       PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ldb_transaction_prepare_commit(PyLdb_AsLdbContext(self)), PyLdb_AsLdbContext(self));
+       Py_RETURN_NONE;
+}
+
 static PyObject *py_ldb_transaction_cancel(PyLdbObject *self)
 {
        PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ldb_transaction_cancel(PyLdb_AsLdbContext(self)), PyLdb_AsLdbContext(self));
@@ -1224,6 +1230,9 @@ static PyMethodDef py_ldb_methods[] = {
        { "transaction_start", (PyCFunction)py_ldb_transaction_start, METH_NOARGS, 
                "S.transaction_start() -> None\n"
                "Start a new transaction." },
+       { "transaction_prepare_commit", (PyCFunction)py_ldb_transaction_prepare_commit, METH_NOARGS,
+               "S.transaction_prepare_commit() -> None\n"
+               "prepare to commit a new transaction (2-stage commit)." },
        { "transaction_commit", (PyCFunction)py_ldb_transaction_commit, METH_NOARGS, 
                "S.transaction_commit() -> None\n"
                "commit a new transaction." },