Pydo pools - two simple questions
"Richard Shea" <[email protected]> Tue, 01 Aug 2006 12:23:26 +1200
| Newsgroups | gmane.comp.web.skunkweb |
|---|---|
| Message-ID | <[email protected]> |
Hi - I'm using Pydo with MySQL but after the system has not been used
for a while I keep getting the dreaded "MySQL has gone away" message.
FIRST QUESTION:
I understand using a Pool may help this but is this only true if I
override subclass ConnectionPool and override onHandOut or will it just
help anyway ? (I'm not 100% sure what to do in onHandOut otherwise I'd
just try). Any examples ?
SECOND QUESTION:
I define a connection and then import that into a class which subclasses
PyDO (see below). Will the connection get returned to the pool after
every method invocation of Programme ? I have a feeling it won't !
ConnectionPyDo2:
================
from pydo import *
delAlias('corptrack0')
dicConnection={}
dicConnection['host'] = 'localhost'
dicConnection['user'] = 'corpdba'
dicConnection['passwd'] = 'corpdba'
dicConnection['db'] = 'corptrack'
initAlias('corptrack0', 'mysql',dicConnection,True,True)
Programme
=========
from pydo import *
import ConnectionPyDo2
class Programme(PyDO):
connectionAlias='corptrack0'
table='eva_programme'
mutable=True
refetch=True
fields=(Sequence('PRG_AUTOID'),
Unique('PRG_TITLE'),
'PRG_OVERVIEW',
#... blah ...
... thanks
richard.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV