pascalin / pycoon

Automatically exported from code.google.com/p/pycoon
GNU General Public License v2.0
0 stars 0 forks source link

mod_python cleanup() function should not be used #2

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
mod_python allows the inclusion of a function called cleanup() in a 
handler module which should be executed upon server shutdown. However, in 
reality Apache provides no reliable mechanism to guarantee that 
operations can be performed when the server shuts down.

See: 
http://www.modpython.org/pipermail/mod_python/2006-August/021853.html for 
details.

The current Pycoon code makes use of the cleanup() function to release 
database connections.

A possible solution to this would be to employ a 'connection pooling' 
mechanism which runs in a separate process to Apache and use 
inter-process communication (possibly with network sockets) to pass 
information between the Pycoon handler (in the Apache process) and the 
connection pool container process.

Original issue reported on code.google.com by pyc...@gmail.com on 31 Aug 2006 at 9:57

GoogleCodeExporter commented 9 years ago
The only way to release resources in r120 is implicit one (by the Pycoon garbage
collector). You can't rely on any cleanup mechanisms, as for now. When are 
going to
implement database data sources, we will think about it again.

Original comment by anrien...@gmail.com on 26 Feb 2007 at 9:01