From: Jeff Ellen <tgje_uiuc@ya...> - 2003-02-10 19:41:40
I had a quick question about the MySQLObjectStore in
Middlekit. Is there a 'close()' or some other such
method that I am missing out on? I think the
'persistent store' is a little too persistent.
Whenever I call MySQLObjectStore.fetchObjectsOfClass()
a connection is opened to MySQL that performs it's
operation then sleeps. The connection doesn't go away
until termination of the entire program. I am trying
to execute something like
for item in list
results = store.fetchObjectsOfClass('a',
clauses="WHERE field='%s'" % strIndexname);
And I get the following error as MySQL rapidly fills
up with sleeping connections, presumably one opened
for each time through the for loop:
File ".\MiddleKit\Run\MySQLObjectStore.py", line 33,
line 63, in Connect
return apply(Connection, args, kwargs)
line 115, in __init__
line 41, in _make_connection
apply(super(ConnectionBase, self).__init__, args,
OperationalError: (1040, 'Too many connections')
I am using Webware 0.7 and MySQL 3.23-NT
Any help would be greatly appreciated. Thanks,
P.S. this problem is even worse when using WinPython.
The sleeping connections to MySQL don't go away even
after the python program has completely executed,
closing WinPython is the only way to get MySQL to
release the sleeping connections.
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.