Hi,

On Tue, Dec 15, 2009 at 3:20 PM, Metin Akat <[email protected]> wrote:
> Thanks for this. It will certainly be quite useful in some setups.
> I had a look in the project code generated by shabti_couchdbkit.
> As far as I can see, this template tries to be "compatible" with
> sqlalchemy way of doing things.
>
> And I am still wondering... Isn't it better to initialize database
> objects for example in lib/app_globals.py as I only need them
> initialized once and not at every request.
>
> I may be wrong of course, as I am not very much familiar with pylons
> internals. And maybe the "sqlalchemy" way of initializing engines and
> sessions has it's reasoning. If so, could anyone please explain it to
> me?
>

Pylons need to have a thread safe sql session so you can't share it in
app_globals

I guess you can define a couchdbkit connection in app_globals but
couchdbkit is thread safe and manage his own pool of http connections
so you don't have to take care of this AFAIK.
That why I've put the init stuff in models/meta.py

I'm ccing Benoit in case I'm wrong.

--
Gael

>
> Regards,
> Metin
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "pylons-discuss" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/pylons-discuss?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.


Reply via email to