Support for multiprocessing connection or sessions handlers similar to SQL Alchemy Engine
Can you get into more detail?  What kind of issues are you seeing.
 We were creating the DB connection object in the model.py class and then
importing it the same in the parent and child process. So  it wasn't a
connection issue but rather a shared object/namespace issue in Python with
multiprocessing. We were hitting a 'commands out of sync' error from MySQL.
We ended up just making a model for the parent and a model for the child
process. This is messy and not the proper way for a fix but it works.
Ideally we would like to instantiate the model class instead of importing
it and move the connection to the main class within model.  For instance:

#####
Import model as dbm

model_obj = dbm.MasterModel()
#MasterModel would contain the connection obj
user = model_obj.User.get()
#####

However we had limited success building that. It's likely an issue with my
understanding of class construction rather than an issue with Peewee.

On Friday, March 22, 2013, Charles Leifer wrote:

> Can you get into more detail? What kind of issues are you seeing.
> 
> —
> Reply to this email directly or view it on GitHubhttps://github.com/coleifer/peewee/issues/173#issuecomment-15281333
> .
 Unfortunately I still am not clear on what exactly happens.  Can you give me some code to replicate it?  Are you using the multiprocessing library and passing model instances around, or are you just calling fork?

The way that peewee handles the DB connection is pretty straightforward.  It is stored in a threadlocal (or a dummy threadlocal) on the database instance.  You can open a connection explicitly by calling `db.connect()` or you can open one implicitly when you execute a query.
 @zahlenofzahlen -- please update so I can resolve or close.
 Closing -- please reopen if you can provide me a bit more info!

Looking for an easy way to implement multiprocessing with peewee. I'm running into locking issues because the Pwiz generated model or basemodel class does not support closing the database connection after each call. Any ideas?
