Singleton are not the solution if you are in a multiprocess
environment.

gc and cache.ram have the same problem.

You can use cache.disk or db.

On Aug 2, 3:39 am, Tomas Pelka <tompe...@gmail.com> wrote:
>   Hi all,
>
> I'm just wondering how to ensure creating only one instance of object.
> Methods that comes on my mind:
> * use gc module and search object by id -- inefficient
> * singleton
> * __init__.py?
> * serialize object to DB?
> * other ...
>
> Cold somebody give me an advise, which way is the best/clean for web2py?
>
> Thank you
>
> --
> Tomas Pelka

Reply via email to