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

Re: LMDB mdb_dbi_open mystery



Lucio De Re wrote:
> On 2019/02/11 09:22, Howard Chu wrote:
>> *Opening*  a DBI handle can only be done by one transaction.*Using*  an open DBI handle
>> can be done by any transactions.
> 
> That still means that the "opening transaction" must complete before the handle becomes public.

Yes, that's exactly what the documentation says:

>>>* After a successful commit the handle will reside in the shared
>>>* environment, and may be used by other transactions.
 > I guess (I really am applying commonsense, here, so I could be
> wrong in real terms) that such an opening transaction ought to be restricted to the open and nothing else, unless it is going to be the only one.

There is no such requirement, but obviously if you want to use the handle from other threads
and transactions, it would make sense to complete the opening txn as quickly as possible.
> 
> Lucio.
> 
> PS: Clarifying this rather subtle point may be worth an extra paragraph in the documentation.

There's nothing subtle here, the doc is quite explicit. Wasting additional paragraphs
only brings complaints from users that "the docs are too big to read."

-- 
  -- Howard Chu
  CTO, Symas Corp.           http://www.symas.com
  Director, Highland Sun     http://highlandsun.com/hyc/
  Chief Architect, OpenLDAP  http://www.openldap.org/project/