[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: mdb_dbi_open and threads



So when the doc says

     * The database handle will be private to the current transaction until
     * the transaction is successfully committed.

"the handle being private" only refers to the first mdb_dbi_open.
Once this transaction is committed, one doesn't have to call this again in subsequent concurrent transactions and can use this handle.
And then this handle won't be private at all.

Did I get it right?



On Sat, May 20, 2017 at 6:44 AM, Hallvard Breien Furuseth <h.b.furuseth@usit.uio.no> wrote:
On 20/05/17 02:14, Muhammed Muneer wrote:
Does the doc mean I can't simultaneously read the same named dbi from multiple threads because I have to wait for readers in other threads to commit before starting a read of the same named dbi?

No, only that you cannot _open_ DBIs in simultaneous threads. Begin a
transaction, open DBI(s) in it, and commit.  Commit makes the new
database snapshot and newly opened DBIs visible to transactions which
begin _after_ the commit.  Those later transactions can use the DBI
simultaneously, since they do not need mdb_dbi_open().

Hallvard