Dorian Taylor (Lists) wrote: > > >> On Apr 9, 2020, at 10:33 AM, Howard Chu <[email protected]> wrote: >> >> There is no point in nesting a read-only txn. Nesting is used to allow work >> to be subdivided >> so that one set of writes can be rolled back independently of the rest of >> the txn. In a readonly >> txn there is never anything to rollback. > > This is what I figured, albeit from what I can glean, the system doesn’t > complain if you do. But then my only experience with LMDB is this one Ruby > binding I inherited, and I am trying to reconcile how the previous author > designed the transaction code to work with the behaviour I observe.
A language binding should be a transparent pipe. It should relay whatever parameters the caller supplied down to the underlying library, and return the results. It shouldn't try to guess at or impose any behaviors. In this particular case, transaction nesting is already documented to only be supported for write txns, and an error will be returned for any attempt to use nesting with a read txn. The binding should allow the caller to try anything, and return the underlying error code when it fails. -- -- Howard Chu CTO, Symas Corp. http://www.symas.com Director, Highland Sun http://highlandsun.com/hyc/ Chief Architect, OpenLDAP http://www.openldap.org/project/
