On Nov 11, 2007, at 3:58 PM, [EMAIL PROTECTED] wrote:

>
> If a process with a reference to an engine (and hence a connection
> pool) forks, how can I be sure that the child process closes any
> inherited descriptors before creating its own engine and connections?
>
> If the child calls dispose() on an engine it has inherited, the engine
> seems to 'dispose' of any underlying pool only to recreate it.  Is it
> safe then to use the inherited engine (since it has a new pool of
> connections), or should a new one be created?  If the latter, how can
> I ensure that all resources associated with the inherited one are
> freed?
>
> Any guidance would be appreciated.


if you call dispose() on an engine or connection pool, all connections  
referenced are closed.  continuing to use the engine or pool means it  
will just start recreating connections again as though it were brand  
new.  not sure if the active "close all connections" logic would break  
in a child process though (i.e., if the inherited connection objects  
are invalid in some way due to the fork).

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

Reply via email to