Hi,

For anyone else that might be wondering this issue,
I tried Ross Peoples solution:

db_thread = DAL(db._uri)
for k, v in db.items():
    db_thread[k] = v

And it did not work properly (it did feel a bit hack anyway).

One pretty bad solution to this issue is to use threading.Lock() in
every single db query / commit etc.

I will however look into multiprocessing and on the advice from
Massimo.

Thanks to everybody that helped with this issue!

Kimmo


On 24 touko, 06:26, Massimo Di Pierro <[email protected]>
wrote:
> write a normal python program using multiprocessing...
>
> within each process do
>
> from gluon.shell import env
> globals().update(env('appname',import_models=True))
>
> and now you have your own db, request, response, etc.
>
> I did not try it but it should work fine.
> There may be a path issue since this expects to find applications in
> ther current working folder.
>
> Massimo
>
> On May 23, 9:47 pm, pbreit <[email protected]> wrote:
>
>
>
>
>
>
>
> > Use the multiprocessing library (to implement background processes).

Reply via email to