[sqlalchemy] QueuePool Problem
Hello I am running an application with cherrypy, sqlalchemy and mysql. All is working fine but sometimes after inserting many data i get the following messages. I am using an scoped_session and remove the session if i don't need it. I only see 3 databases processe in the mysql database. br Jürgen Hauptmann 500 Internal Server Error The server encountered an unexpected condition which prevented it from fulfilling the request. Traceback (most recent call last): File /usr/lib/python2.4/site-packages/cherrypy/_cprequest.py, line 551, in respond cherrypy.response.body = self.handler() File /usr/lib/python2.4/site-packages/cherrypy/_cpdispatch.py, line 24, in __call__ return self.callable(*self.args, **self.kwargs) File server.py, line 60, in view fall = session.query(Fall).filter_by(id=id).one() File /usr/lib/python2.4/site-packages/SQLAlchemy-0.4.7p1-py2.4.egg/sqlal chemy/orm/query.py, line 924, in one ret = list(self[0:2]) File /usr/lib/python2.4/site-packages/SQLAlchemy-0.4.7p1-py2.4.egg/sqlal chemy/orm/query.py, line 938, in __iter__ return self._execute_and_instances(context) File /usr/lib/python2.4/site-packages/SQLAlchemy-0.4.7p1-py2.4.egg/sqlal chemy/orm/query.py, line 941, in _execute_and_instances result = self.session.execute(querycontext.statement, params=self._params, mapper=self.mapper, instance=self._refresh_instance) File /usr/lib/python2.4/site-packages/SQLAlchemy-0.4.7p1-py2.4.egg/sqlal chemy/orm/session.py, line 628, in execute return self.__connection(engine, close_with_result=True).execute(clause, params or {}) File /usr/lib/python2.4/site-packages/SQLAlchemy-0.4.7p1-py2.4.egg/sqlal chemy/orm/session.py, line 600, in __connection return self.transaction.get_or_add(engine) File /usr/lib/python2.4/site-packages/SQLAlchemy-0.4.7p1-py2.4.egg/sqlal chemy/orm/session.py, line 217, in get_or_add conn = bind.contextual_connect() File /usr/lib/python2.4/site-packages/SQLAlchemy-0.4.7p1-py2.4.egg/sqlal chemy/engine/base.py, line 1239, in contextual_connect return Connection(self, self.pool.connect(), close_with_result=close_with_result, **kwargs) File /usr/lib/python2.4/site-packages/SQLAlchemy-0.4.7p1-py2.4.egg/sqlal chemy/pool.py, line 170, in connect agent = _ConnectionFairy(self) File /usr/lib/python2.4/site-packages/SQLAlchemy-0.4.7p1-py2.4.egg/sqlal chemy/pool.py, line 323, in __init__ rec = self._connection_record = pool.get() File /usr/lib/python2.4/site-packages/SQLAlchemy-0.4.7p1-py2.4.egg/sqlal chemy/pool.py, line 180, in get return self.do_get() File /usr/lib/python2.4/site-packages/SQLAlchemy-0.4.7p1-py2.4.egg/sqlal chemy/pool.py, line 604, in do_get raise exceptions.TimeoutError(QueuePool limit of size %d overflow %d reached, connection timed out, timeout %d % (self.size(), self.overflow(), self._timeout)) TimeoutError: QueuePool limit of size 30 overflow 10 reached, connection timed out, timeout 30 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Re: Problem using utf-8
Thank you. Switching to 1.2.2 and using connect_args = {'use_unicode': False,'charset': 'utf8'} works fine for me. Jürgen Michael Bayer schrieb: I believe this is the ticket: http://sourceforge.net/tracker/index.php?func=detailaid=1592353group_id=22307atid=374932 its a little ambiguous as to its resolution, maybe I'll ask Shannon what his most recent experiences were. On Sep 17, 2008, at 12:03 PM, Bo Shi wrote: While researching which version to deploy, I had run into a thread post _claiming_ that 1.2.2 had a critical bug which was documented in the fedora bugzilla. I never managed to actually find said bug but it scared me off. The reason we went with 1.2.1p2 was because it was the version the Django people have been using with success. At any rate, the workaround I posted seems to work for us thus far, though I don't have a good understanding of exactly why it works (I suspect it tiptoes around a double-encoding bug in mysqldb). Bo On Wed, Sep 17, 2008 at 11:31 AM, Michael Bayer [EMAIL PROTECTED] wrote: On Sep 17, 2008, at 10:50 AM, Bo Shi wrote: I ran into a similar issue using MySQL-python-1.2.1_p2-1 (mysqldb) with SA 0.4.2p3-1. I would advise upgrading to MySQL-python 1.2.2. I believe some utf-8 issues have been fixed. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Problem using utf-8
Hi Im using utf-8 in my mysql tables. If i insert a String with German Umlaute like Ü it is converted to Ãœ in the database, it ist returned as Ü. - What can i do that this will be correctly saved? my connection looks like this: engine = create_engine('mysql://xxx:[EMAIL PROTECTED]/test123', echo=False, pool_size=30, pool_recycle=3600) use_unicode, or the other Parameters doesn't work for me. the table definition looks like this: raum_table = Table('raum', metadata, Column('id', Integer, ForeignKey('objekt.id'),primary_key=True), Column('name', Unicode(100)), Column('anzahl', Integer), Column('raumbezeichnung', Integer), Column('raumtyp', Integer), Column('siedlungstyp', Integer), Column('gebaeude', Unicode(200)), Column('gebaeudeteil', Unicode(200)), Column('fundstelle', Unicode(200)), Column('befundgattung', Integer), Column('befund', Unicode(200)), Column('orttyp', Integer), Column('ort', Integer) ) the mapper looks like this: mapper(Raum, raum_table, inherits=Objekt, polymorphic_identity='raum', properties={ 'personen':relation(Person, secondary = person_raum_table), 'handlungen':relation(Handlung, secondary = raum_handlung_table), 'objekte':relation(WObjekt, secondary = wobjekt_raum_table), 'eigenschaften' : relation(Eigenschaft, secondary = eigenschaft_raum_table) } ) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---