[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: Regarding Transactions that span Multiple files
- To: Mohammed Muneer <elendilm@gmail.com>, openldap-technical@openldap.org
- Subject: Re: Regarding Transactions that span Multiple files
- From: Howard Chu <hyc@symas.com>
- Date: Mon, 21 Dec 2015 18:10:48 +0000
- In-reply-to: <CAMvTE2MVnk4d92jA65E4L5UduLjSbZBu=CJE0nSdOQPCnxjaZg@mail.gmail.com>
- References: <CAMvTE2MVnk4d92jA65E4L5UduLjSbZBu=CJE0nSdOQPCnxjaZg@mail.gmail.com>
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0 SeaMonkey/2.42a1
Mohammed Muneer wrote:
Create Env - staff
Create Env - payroll
Create Txn_staff
Create Txn_payroll
Begin write transaction for Txn_staff
Insert staff data
Set Txn_payroll parent to Txn_staff
Begin write transaction for Txn_payroll
Insert payroll data
Commit Txn_payroll
Commit Txn_staff
------------------------------------------------------------------
Can the above Pseudocode work in lmdb ? Or in other words
can a transactions span multiple env's?
No. But a single env can contain multiple DBs, and a txn can span multiple DBs
within the same env:
Create Env
Create DB - staff
Create DB - payroll
mdb_txn_begin(env, NULL /*parent*/, &txn_staff) - 1st write txn
insert staff data
mdb_txn_begin(env, txn_staff /*parent*/, &txn_payroll)
insert payroll data
mdb_txn_commit(txn_payroll)
mdb_txn_commit(txn_staff)
--
-- Howard Chu
CTO, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc/
Chief Architect, OpenLDAP http://www.openldap.org/project/