The fool proof way would be to not use dbsession inside of your config cycle. 
You are more than welcome to implement whatever functionality you need though, 
but it's up to you to do so safely.

I don't believe it is worth the time for us to implement/test/and maintain that 
code as part of Pyramid or anywhere else, if you are accessing the database 
outside of a request lifecycle we can't provide all of the measures to do so 
safely.

Bert

> On Apr 2, 2018, at 10:41, Zsolt Ero <zsolt....@gmail.com> wrote:
> 
> Wouldn't the second / "foolproof" way described here be a good choice
> for the default Pyramid implementation? Just as a safety measure.
> 
> http://docs.sqlalchemy.org/en/latest/core/pooling.html#using-connection-pools-with-multiprocessing
> 
> On 2 April 2018 at 18:32, Jonathan Vanasco <jvana...@gmail.com> wrote:
>> 
>> 
>> On Monday, April 2, 2018 at 12:07:14 PM UTC-4, Bert JW Regeer wrote:
>>> 
>>> 
>>> This is only required if you are not using pyramid_tm. If you are using
>>> pyramid_tm which is what the sqlalchemy cookie cutter does, you do NOT need
>>> to add this.
>> 
>> 
>> Thanks, Bert.  I stand corrected.  pyarmid_tm has a finish() that eventually
>> calls a session.close() in Zope.SqlAlchemy.
>> 
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "pylons-discuss" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/pylons-discuss/_MJflNUcjdg/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> pylons-discuss+unsubscr...@googlegroups.com.
>> To post to this group, send email to pylons-discuss@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/pylons-discuss/e1f81475-8b31-44ca-b0cf-af3448a3b131%40googlegroups.com.
>> 
>> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to pylons-discuss+unsubscr...@googlegroups.com.
> To post to this group, send email to pylons-discuss@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/pylons-discuss/CAKw-smAQ5QWad0eBA60MTDNS9EBxCrxV%3D4wDQT%3DxvnERP%2BUOhw%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To post to this group, send email to pylons-discuss@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/3B860CC9-4D22-41FE-9CBF-3ED77A48F43F%400x58.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to