On Dec 17, 2011, at 8:16 AM, Sharpek wrote:

> Hi,
> 
> I have fallowing error, with SQLAlchemy 0.7.4.
> 
> This is my trackback:
> 
> 2011-12-17 14:08:55,730 INFO sqlalchemy.pool.QueuePool Invalidate
> connection <_mysql.connection open to 'sql.wmasg.pl' at 3a79730>
> (reason: OperationalError:(2006, 'MySQL server has gone away'))
> 2011-12-17 14:08:55,731 INFO sqlalchemy.pool.QueuePool Pool disposed.
> Pool size: 10  Connections in pool: 0 Current Overflow: -10 Current
> Checked out connections: 0
> 2011-12-17 14:08:55,731 INFO sqlalchemy.pool.QueuePool Pool recreating
> Traceback (most recent call last):
>  File "/home/users/sharpek/sites/mysite.net/env/lib64/python2.7/site-
> packages/pyramid-1.3a2-py2.7.egg/pyramid/router.py", line 187, in
> __call__
>    response = self.handle_request(request)
>  File "/home/users/sharpek/sites/mysite.net/env/lib64/python2.7/site-
> packages/pyramid-1.3a2-py2.7.egg/pyramid/tweens.py", line 20, in
> excview_tween
>    response = handler(request)
>  File "/home/users/sharpek/sites/mysite.net/env/lib64/python2.7/site-
> packages/pyramid-1.3a2-py2.7.egg/pyramid/router.py", line 164, in
> handle_request
>    response = view_callable(context, request)
>  File "/home/users/sharpek/sites/mysite.net/env/lib64/python2.7/site-
> packages/pyramid-1.3a2-py2.7.egg/pyramid/config/views.py", line 316,
> in rendered_view
>    result = view(context, request)
>  File "/home/users/sharpek/sites/mysite.net/env/lib64/python2.7/site-
> packages/pyramid-1.3a2-py2.7.egg/pyramid/config/views.py", line 402,
> in _class_requestonly_view
>    response = getattr(inst, attr)()
>  File "/home/users/sharpek/sites/mysite.net/v8/v8/modules/index/page/
> views.py", line 41, in index
>    'reportage_list': self.get_reportage_list(),
>  File "/home/users/sharpek/sites/mysite.net/v8/v8/modules/index/page/
> views.py", line 19, in get_reportage_list
>    return generate_html(self, 'mainpage_reportages')
>  File "/home/users/sharpek/sites/mysite.net/env/lib64/python2.7/site-
> packages/Beaker-1.6.2-py2.7.egg/beaker/cache.py", line 567, in cached
>    return cache[0].get_value(cache_key, createfunc=go)
>  File "/home/users/sharpek/sites/mysite.net/env/lib64/python2.7/site-
> packages/Beaker-1.6.2-py2.7.egg/beaker/cache.py", line 303, in get
>    return self._get_value(key, **kw).get_value()
>  File "/home/users/sharpek/sites/mysite.net/env/lib64/python2.7/site-
> packages/Beaker-1.6.2-py2.7.egg/beaker/container.py", line 382, in
> get_value
>    v = self.createfunc()
>  File "/home/users/sharpek/sites/mysite.net/env/lib64/python2.7/site-
> packages/Beaker-1.6.2-py2.7.egg/beaker/cache.py", line 565, in go
>    return func(*args)
>  File "<string>", line 2, in generate_html
>  File "/home/users/sharpek/sites/mysite.net/v8/v8/core/handlers.py",
> line 86, in wrapper
>    rendered = render(tpl, func(self, *args, **kwargs), getattr(self,
> 'request', None))
>  File "/home/users/sharpek/sites/mysite.net/v8/v8/modules/index/page/
> views.py", line 16, in generate_html
>    'reportages': Album.get_reportage_list(Album.REPORTAGE_MAINPAGE,
> 5)
>  File "/home/users/sharpek/sites/mysite.net/v8/v8/modules/album/
> models.py", line 76, in get_reportage_list
>    return sql.all()
>  File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/query.py", line
> 1947, in all
>  File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/query.py", line
> 2057, in __iter__
>  File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/query.py", line
> 2072, in _execute_and_instances
>  File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py", line
> 1405, in execute
>  File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py", line
> 1538, in _execute_clauseelement
>  File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py", line
> 1646, in _execute_context
>  File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py", line
> 1639, in _execute_context
>  File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/default.py",
> line 330, in do_execute
>  File "build/bdist.linux-x86_64/egg/MySQLdb/cursors.py", line 174, in
> execute
>  File "build/bdist.linux-x86_64/egg/MySQLdb/connections.py", line 36,
> in defaulterrorhandler
> sqlalchemy.exc.OperationalError: (OperationalError) (2006, 'MySQL
> server has gone away') 'SELEC
> 
> My enviroment:
> 
> Pyramid, SQLAlchemy, Python 2.7,

It looks like you have a complex system of using Beaker caching in conjunction 
with Pyramid views going on , I'm not sure how a Beaker->get() operation is 
leading down into a Pyramid view config and all.  Basically you need to 
illustrate your architecture to the folks on the Pyramid list - unfortunately 
this is not just an engine config issue.      The MySQL error is likely from 
multithreaded access to a single connection, which can be from multithreaded 
access on a single object.   Basically if turning off threads solves the issue 
you'd know that thread-unsafe access is the problem.



-- 
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 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to