Hi Massimo,

Thanks for this. Do you know if it will hold up in a high performance
situation though?
As in, if multiple connections originate at the same time, won't there
be a queue?
Is it possible to simulate the connection pooling mechanism in
web2py's DAL?

Thanks,
Karthik

On Jul 31 2010, 4:13 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
> how about this? (None below means cache forever)
>
> def make_connection():
>     from pymongo import Connection
>     connection = Connection('localhost', 27017)
>     return connection
>
> connection = cache.ram('mongodb',make_connection,None)
>
> On Jul 31, 3:11 am, David Marko <dma...@tiscali.cz> wrote:
>
>
>
>
>
>
>
> > Hi Massimo, can you give ua a hint how to impelement persistent
> > connection in web2py for pyMongo? PyMongo requires database connection
> > and to use it efficiently the connection has to be persistent and
> > shared among requests like a connection pool for database connections
> > as DAL has. But how to do it in web2py?
>
> > e.g.
> > from pymongo import Connection
> > connection = Connection('localhost', 27017)
>
> > ### how to keep this connection object?
>
> > David
>
> > On 31 čnc, 09:57, mdipierro <mdipie...@cs.depaul.edu> wrote:
>
> > > yes. Just set dbio=False in forms and do your own mymongo IO after
> > > accepts:
>
> > > On Jul 30, 11:18 am, Amit Ambardekar <amit...@gmail.com> wrote:
>
> > > > I want to use web2py with pymongo.
> > > > I don't need ORM or or anything. I just want to connect use pymongo
> > > > from Web2Py.
> > > > How can I use it inside web2py. I need it for high performance use.
>
> > > > Amit

Reply via email to