[py-lmdb] Re: create_env() and open_env()

  • From: David Wilson <dw@xxxxxxxx>
  • To: py-lmdb@xxxxxxxxxxxxx
  • Date: Fri, 23 May 2014 14:09:39 +0000

Just call lmdb.open() or lmdb.Environment() using the same parameters in
both processes, nothing else required. Most of the environment
parameters aren't persistent, although some may be (I forget which right
now).


David

On Fri, May 23, 2014 at 06:42:41AM -0700, Dinesh Vadhia wrote:
> Say, there are 2 programs:
> 
> module#1 - one-off module to initialize (or configure) an lmdb Env
> 
> module#2 - use Env and one or more db's
> 
> What is the flow now?
> 
> 
> --------------------------------------------------
> From: "David Wilson" <dw@xxxxxxxx>
> Sent: Friday, May 23, 2014 5:24 AM
> To: <py-lmdb@xxxxxxxxxxxxx>
> Subject: [py-lmdb] Re: create_env() and open_env()
> 
> >Aah, now I understand.
> >
> >Yes, the flow is:
> >
> >* mdb_env_create() allocates a MDB_env on the heap, but does nothing
> >  else.
> >
> >* mdb_env_set_flags() controls options used for the MDB_env
> >
> >* mdb_env_open() physically constructs the on-diks representation and
> >  populates the MDB_env with data from it.
> >
> >* mdb_env_close() stops using the disk file and deallocates the MDB_env
> >
> >
> >lmdb.Environment.__init__() does a combination of mdb_env_create(),
> >mdb_env_set_flags(), and mdb_env_open().
> >
> >
> >David
> >
> >
> 

Other related posts: