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

Re: LMDB: transactions across dbis, dbi lifetime



hyc@symas.com said:
> >    In other words, may a txn span multiple dbis?
> 
> Of course. Where in the quoted doc is it ever implied otherwise?

Sorry, I was thinking about two separate things at the same time when I
wrote this, this one is not related to the quoted doc. Thanks for answering
anyway.

> [...]

> >3. Is the dbi still valid if a subsequent transaction on it is aborted with
> >    mdb_txn_abort()? The first part of the quoted paragraph suggests not...?
> 
> Why would you expect any subsequent abort to have any effect? This
> is the entire point of a transactional DB system - any event
> occurring in a transaction can only be committed once, or aborted
> once. No subsequent aborts can rollback anything from a prior
> commit.

I wouldn't and of course that's the point of a transactional DB. Perhaps I
wasn't clear, let me try again:

Perhaps the doc for mdb_dbi_open() could be improved as follows:

    The database handle will be private to the current transaction until
    the transaction is successfully committed. If the transaction which
    used this function is aborted the handle will be closed automatically. 

I added "...which used this function..." to make it unambiguous which
transaction the text is referring to.

Martin