durusmail: quixote-users: Sharing a database connection
Sharing a database connection
2003-08-07
2003-08-07
2003-08-07
Sharing a database connection
Simon Cusack
2003-08-07
Friday, August 8, 2003, 12:42:19 AM, you wrote:

V> I am using quixote+mod_python as a front-end for a database app.  I
V> would like the database connections to persist somewhere -- probably in
V> the interpreter attached to the apache process -- so that I do not have
V> to reconnect with each request.

V> However, I am unsure how to do this, and how to then access that db
V> connection from quixote.  Does anyone know how this is a accomplished?

Hi,

I am using scgi but I have had great success with Pyro, basically Pyro
runs on its own somewhere (can even be on another machine) and your
process requests objects from it. Once it has an object it can call
methods on it as if it was local but it is really happening in the
other process.

This is handy even for cgi setups as the expensive setup like database
handles and session manager is done in the other process and your cgi
script only has to connect to the proxy. This makes testing much
simpler.

Check out;
http://pyro.sourceforge.net/

They have something called a name server, I used that at first but it
was a bit of overkill, so make sure you check out the noNS example,
this sets up a much simpler client/server relationship.

I have tested this on XP and OpenBSD.

Regards, Simon Cusack.


reply