How many ObjectStore objects do you have living? I believe you are only supposed to have one instance for your entire application. I had a lot of trouble with running out of connections when I first started using MiddleKit, and as I recall I fixed it by making a global MySQLObjectStore instance.

-winston

On Jan 25, 2005, at 5:43 PM, jacob martinson wrote:

I think this creates another problem. A new connection/cursor is
created for every object that is stored when you call
"store.saveChanges()".

If my mysql max_connections variable is less than the number of
objects I have to commit, I'll get an exception like this:

Traceback (most recent call last):
File "./nstest.py", line 27, in ?
main()
File "./nstest.py", line 24, in main
store.saveChanges()
File "MiddleKit/Run/ObjectStore.py", line 316, in saveChanges
File "MiddleKit/Run/SQLObjectStore.py", line 193, in commitInserts
File "MiddleKit/Run/SQLObjectStore.py", line 211, in _insertObject
File "MiddleKit/Run/SQLObjectStore.py", line 339, in executeSQL
File "MiddleKit/Run/SQLObjectStore.py", line 375, in connectionAndCursor
File "/root/src/Webware-0.8.1/MiddleKit/Run/MySQLObjectStore.py",
line 33, in newConnection
return self.dbapiModule().connect(**args)
File "/usr/lib/python2.3/site-packages/MySQLdb/__init__.py", line
64, in Connect
return Connection(*args, **kwargs)
File "/usr/lib/python2.3/site-packages/MySQLdb/connections.py", line
100, in __init__
super(Connection, self).__init__(*args, **kwargs2)
_mysql_exceptions.OperationalError: (1040, 'Too many connections')

If I increase max_connections beyond the number of objects I try save
at once it works fine.

I guess the solution is to downgrade my python/mysql library or just
up max_connections for now?

Thanks!

-Jacob


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Webware-discuss mailing list
Webware-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/webware-discuss


_________________________________________
winston wolff - (646) 827-2242 - http://www.stratolab.com - learning by creating

Reply via email to