Re: [Zope-DB] mysql / zope db connection issue
On 4/6/06, Charlie Clark [EMAIL PROTECTED] wrote: This still should not be causing this problem. Jamie, you should be talking to the DBA or looking at the DB side of things. Well it is a volunteer operation, so we don't specifically have a dba, but will talk with the person who set up the db. Is the DB running on the same machine as Zope or on the network? Yes. What are connection times set to? Do you mean the connection timeout time? It might simply be that MySQL is running out of connections although this usually means that the whole machine runs slow. We upped the # of connections and I have seen 51 connections open at one time. Not sure the rate at which people are accessing the form and submitting it, but I believe it may be 25-50 a day. Jamie ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] mysql / zope db connection issue
Hi Dieter, We switched to Postgres, MySQL is used only for legacy components. Isn't postgres linux only? We use FreeBSD. Jamie ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] mysql / zope db connection issue
Thanks for the suggestions, Charlie. Will try as you suggested. Jamie On 4/6/06, Charlie Clark [EMAIL PROTECTED] wrote: On 2006-04-06 at 16:34:01 [+0200], Jamie O'Keefe [EMAIL PROTECTED] wrote: On 4/6/06, Charlie Clark [EMAIL PROTECTED] wrote: This still should not be causing this problem. Jamie, you should be talking to the DBA or looking at the DB side of things. Well it is a volunteer operation, so we don't specifically have a dba, but will talk with the person who set up the db. Is the DB running on the same machine as Zope or on the network? Yes. What are connection times set to? Do you mean the connection timeout time? Yes. The default for these are very high which often causes problems for applications that don't implement connection pooling. However, as I previously said this is unlikely to be the source of the problem. It might simply be that MySQL is running out of connections although this usually means that the whole machine runs slow. We upped the # of connections and I have seen 51 connections open at one time. Not sure the rate at which people are accessing the form and submitting it, but I believe it may be 25-50 a day. At that rate there is no reason on the Zope side for the connection being dropped. There could be a problem with the underlying Python driver and thus the ZopeDA so you might want to install the latest version of both: http://sourceforge.net/project/showfiles.php?group_id=22307 MySQL 3.2 is still supported. But you should also run Zope in debug mode and see what gets written to the error log. Charlie -- Jamie O'Keefe www.jamesokeefe.org jokeefe.typepad.com - my personal blog jokeefe.typepad.com/green_politics/ - my political blog jokeefe.typepad.com/nonviolence/ - my blog on nonviolence ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] mysql / zope db connection issue
Hi Chris On 4/5/06, Chris Withers [EMAIL PROTECTED] wrote: Jamie O'Keefe wrote: try: result = context.updatePerson(**query_args) return text except Exception: This is insane code. If you want to get mailed errors, look at the MailingLogger product. Did. What if you don't know what the errors could be? The traceback error is: Exception TypeDatabase Error Exception Value updatePerson is not connected to a database What version of Zope/MySQL/mysqldb/ZMySQLDA are you using? Zope is 2.6.4 MySql is 3.22.32 ZMySQLDA 2.0.8 i don't know the version of mysqldb. Thanks. Jamie ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] mysql / zope db connection issue
Hi Dieter, On 4/5/06, Dieter Maurer [EMAIL PROTECTED] wrote: Jamie O'Keefe wrote at 2006-4-5 01:32 -0400: I have written a series of zope pages for a person to update their record in our mysql database. They use a zpt-python-db sql-db driver-db flow and work pretty well. Unfortunately, if enough people use it, the number of open db connections grows until it hits a limit and the db stops accepting connections. I have seen that there is a connection issue with zope and mysql, but have not been able to find a solution. Is there one? We are using MySQL and Zope (via ZMySQLDB) and do not see this problem. Apparently, Zope handles connections in principle correctly... What version of MySQL are you using? One thing I just noticed is that if I connect in via the unix shell client, quit and login again, the number of connections goes up. Not unusual. In a slow period i will need to see if the number goes down as well. Jamie ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] mysql / zope db connection issue
What version of Zope/MySQL/mysqldb/ZMySQLDA are you using? Zope is 2.6.4 MySql is 3.22.32 ZMySQLDA 2.0.8 i don't know the version of mysqldb. I think this is 0.9. Jamie ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
[Zope-DB] mysql / zope db connection issue
Hi, I have written a series of zope pages for a person to update their record in our mysql database. They use a zpt-python-db sql-db driver-db flow and work pretty well. Unfortunately, if enough people use it, the number of open db connections grows until it hits a limit and the db stops accepting connections. I have seen that there is a connection issue with zope and mysql, but have not been able to find a solution. Is there one? Also, I put in some exception handling to trap any db errors and email the post if there are any. However, i am not sure it is working. I performed a test to the db update from my page with the db off and got a Database Error that wasn't caught by my exception handler. I am not sure why since I thought Exception would be the root of Database Errors. My code looks like this: try: result = context.updatePerson(**query_args) return text except Exception: try: mto = to address mfrom = from address subject = Updated supporter information body = printed context.MailHost.simple_send(mto, mfrom, subject, body) print result return text except Exception: errorText = 'h1Ooooppps!/h1pThere was an error submitting your information to our database and our backup logging method. Please email the a href=mailto:webmaster@domainwebmaster/a that you got an error so that we can track it down and fix it./ppThanks!/p' print errorText return printed return errorText The traceback error is: Exception Type Database Error Exception Value updatePerson is not connected to a database Any insights would be most welcome. Thanks! Jamie ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db