[Twisted-Python] db connections
petshmidt at googlemail.com
Tue Mar 24 06:10:17 EDT 2009
I've wrote an daemon which does some queries to db and sends response
back to client. Do I need to make for every request from client (new
instance of MyProtocol) a new connection to DB? Or can I somehow
prepare connection, so I could save some time? Maybe make connection
in Factory and pass it to Protocol? But what happens if too much
clients are connected to server? What is the way to control it?
print "new connection"
self.dbcon = adbapi.ConnectionPool("pyPgSQL.PgSQL",
database="data", user='pet', host='local', password='some')
protocol = MyProtocol
if __name__ == '__main__':
More information about the Twisted-Python