[mod_python] permanent db connection (more than in FAQ 3.3)

Gregory (Grisha) Trubetskoy grisha at modpython.org
Fri Nov 15 11:25:41 EST 2002


There isn't much you can do about this - the connections are only reused
within the same process, a new process will create a new connection.

PythonInterpreter's scope does not extend beyond a process, i.e. a seprate
process is a separate process, a separate memory space, a different
interpreter, etc.

Hope this clarifies it a bit.

Grisha

On Fri, 15 Nov 2002 sandor.kopanyi at mailbox.hu wrote:

> Hi,
>
> In the mod_python FAQ 3.3 there is a good example of a 'permanent'
> database connection. This works fine, the connection is reused, as long
> as the request is handled in the same child process (apache child
> process). But a new child process gets a new interpreter => new
> connection is created. At least that's what I guess.
>
> I've tried the Python*Interp* directives, but the connection is
> re-created regardless of those directives. Am I doing something wrong?
>
> E.g. when setting PythonInterpeter to something (e.g. blabla), the
> connection is recreated again and again.
>
> Any ideeas?
>
> I'm using apache 1.3.23 with mod_python 2.7.6 on RedHat 7.3; the
> application is based on the publisher handler; the db connection code is
> almost copy-paste from the FAQ.
>
> Best regards,
> Sandor
>
>
> ________________________________________________
> http://mailbox.hu - MАr SMS ИrtesМtИssel is!
>
>
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://www.modpython.org/mailman/listinfo/mod_python
>




More information about the Mod_python mailing list