1. I create a read-only transaction on an environment with mdb_txn_begin().
2.Then I get a database handle on the same environment (using mdb_dbi_open() within a separate transaction).
3. Finally I try to create and use a cursor using the database in 2. and transaction in 1. but I get various runtime errors ("Segmentation fault" or "double free or corruption").

However, if I switch 1. and 2., everything works.

Must a database really be created before a transaction? If so, curious to learn if this is mentioned anywhere in the docs (I didn't see it)