For database pooling I've just setup a pool of connections in a file called Config.py that I store in my lib/ directory where I store my classes/modules that I've written to run my web app.

The file looks like this:
from MiscUtils.DBPool import DBPool
from pyPgSQL import PgSQL


datapool = DBPool(PgSQL, 5, 'localhost::mydb:myusername:mypassword')
print "Database Connection Pool successfully created."


Basically what I started doing was to import this module from my __init__.py file in my www/ directory which is the root of my webware context.

This works and I can access it from my servlets/templates but when I do a ctrl-c the AppServer and it shuts down, I get these errors:

LOG: pq_recvbuf: unexpected EOF on client connection
LOG: pq_recvbuf: unexpected EOF on client connection
LOG: pq_recvbuf: unexpected EOF on client connection
LOG: pq_recvbuf: unexpected EOF on client connection
LOG: pq_recvbuf: unexpected EOF on client connection

I've seen this error before using JDBC when you quit an application without explicitly closing the database connection.
So am I initializing the pool in the wrong place and/or is there a shutdown() method somewhere that I need to call a close() on on all the open connections? There's nothing obvious in the DBPool.py module that mentions this.

Thanks



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to