This is thread safe for mysql. You can put the connection in each thread,and use it. like def get_connection(): if not hasattr(get_publish(),'mysql_connection'): t=get_publish() t.mysql_connection=...... 2006/1/19, Lee McAllister: > We've had a similar problem using MySQL 4 due to exceeding the max_packet > size for a result set. I have not experienced a timeout or MySQL server > restart causing this issue yet though. In our case simply increasing the > MySQL servers max_packet size setting resolved our issue. This can be done > either in the MySQL server's configuration or using a query to the server on > a priviledged account. The query would be something like: > > db.query('SET GLOBAL max_allowed_packet=%s' % maxpacket) > > Hope that helps, > > Lee McAllister, Developer > www.mcomi.com | vc 250.380.2006 | fx 250.380.2008 > > > > > >-----Original Message----- > >From: quixote-users-bounces@mems-exchange.org > >[mailto:quixote-users-bounces@mems-exchange.org] On Behalf Of Mike Orr > >Sent: Tuesday, January 17, 2006 1:40 PM > >To: quixote-users@mems-exchange.org > >Subject: [Quixote-users] MySQL server has gone away > > > >I moved my Quixote applications to a new Linux server and upgraded to > >MySQL 5, and suddenly now things hang up sometimes with 'MySQL server > >has gone away' exceptions. The MySQL manual suggests several possible > >reasons (timeout on client thread, large query size/result size, MySQL > >server restarting itself), but I was wondering whether anyone else is > >getting this in a Quixote context, especially with session2. Using > >Quixote 2.4, scgi 1.9, session2 0.6, Apache 2.0.54, MySQL 5.0.16, > >Linux Gentoo 2005.1. > > > >The MySQL server is responding fine; I just have to restart the > >Quixote application. But MySQL shows three idle connections from > >Quixote sleeping. Is something in Quixote or session2 using > >persistent connections? > > > >-- > >Mike Orr > >(mso@oz.net address is semi-reliable) > >_______________________________________________ > >Quixote-users mailing list > >Quixote-users@mems-exchange.org > >http://mail.mems-exchange.org/mailman/listinfo/quixote-users > > > > > > _______________________________________________ > Quixote-users mailing list > Quixote-users@mems-exchange.org > http://mail.mems-exchange.org/mailman/listinfo/quixote-users > -- my gmail:lihuimail(at)gmail.com WukooPy: http://wiki.woodpecker.org.cn/moin/WukooPy http://groups-beta.google.com/group/python-wukoopy