Thanks for the pointer. I have coded a custom tool thet works very
On Dec 2, 10:53 am, João Pinto <
lamego.pi...@gmail.com> wrote:
> Hello Voltron,
> I believe you need to define the pool at the request level, using a tool.
>
> Best regards,
>
> 2009/12/2 Voltron <
nhy...@googlemail.com>
>
>
>
> > I am creating a pooled database connection using this:
>
> > # Very simplified, without try conditionals and so on
>
> > def get_mongodb():
> > connection = Connection("localhost", cherrypy.config.get
> > (db_default.port'), pool_size=5, timeout=-1)
> > cherrypy.request.db = connection[cherrypy.config.get
> > ('production.db')]
>
> > cherrypy.engine.subscribe('start', get_db)
>
> > This makes the connection and stores the db in the request variable,
> > the only problem is, my applications error out with a traceback
> > stating that cherrypy.request.db does not exist.
>
> > How can I store a shared, pooled and thread safe db connection for all
> > my controllers in a request variable?
>
> > Thanks
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "cherrypy-users" group.
> > To post to this group, send email to
cherryp...@googlegroups.com.
> > To unsubscribe from this group, send email to