Issue #171 new

sqlite threading issue

Thomas Waldmann
repo owner created an issue

Configuration: {{{ namespace_mapping, acl_mapping = create_simple_mapping( uri='stores:sqlite:{0}/%(nsname)s.sqlite::%(kind)s'.format(data_dir), content_acl=dict(before=u'', default=u'All:read,write,create,destroy,admin', after=u'', hierarchic=False, ), user_profile_acl=dict(before=u'', default=u'All:read,write,create,destroy,admin', after=u'', hierarchic=False, ), ) }}}

Problem: {{{ Traceback (most recent call last): File "/home/tw/w/moin-2.0/env/lib/python2.7/site-packages/flask/app.py", line 1518, in call return self.wsgi_app(environ, start_response) File "/home/tw/w/moin-2.0/env/lib/python2.7/site-packages/flask/app.py", line 1506, in wsgi_app response = self.make_response(self.handle_exception(e)) File "/home/tw/w/moin-2.0/env/lib/python2.7/site-packages/flask/app.py", line 1504, in wsgi_app response = self.full_dispatch_request() File "/home/tw/w/moin-2.0/env/lib/python2.7/site-packages/flask/app.py", line 1264, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/tw/w/moin-2.0/env/lib/python2.7/site-packages/flask/app.py", line 1262, in full_dispatch_request rv = self.dispatch_request() File "/home/tw/w/moin-2.0/env/lib/python2.7/site-packages/flask/app.py", line 1248, in dispatch_request return self.view_functionsrule.endpoint File "/home/tw/w/moin-2.0/MoinMoin/apps/frontend/views.py", line 368, in modify_item return item.do_modify(contenttype, template_name) File "/home/tw/w/moin-2.0/MoinMoin/items/init.py", line 1200, in do_modify self.modify() # XXX File "/home/tw/w/moin-2.0/MoinMoin/items/init.py", line 461, in modify return self._save(meta, data, contenttype_guessed=contenttype_guessed, comment=comment) File "/home/tw/w/moin-2.0/MoinMoin/items/init.py", line 510, in _save contenttype_guessed=contenttype_guessed, File "/home/tw/w/moin-2.0/MoinMoin/storage/middleware/protecting.py", line 223, in store_revision rev = self.item.store_revision(meta, data, overwrite=overwrite, **kw) File "/home/tw/w/moin-2.0/MoinMoin/storage/middleware/indexing.py", line 869, in store_revision revid = backend.store(meta, data) File "/home/tw/w/moin-2.0/MoinMoin/storage/middleware/routing.py", line 108, in store revid = backend.store(meta, data) File "/home/tw/w/moin-2.0/MoinMoin/storage/backends/stores.py", line 136, in store self.data_store[dataid] = tfw File "/home/tw/w/moin-2.0/MoinMoin/storage/stores/sqlite.py", line 128, in setitem self.conn.execute('insert into {0} values (?, ?)'.format(self.table_name), (key, buffer(value))) ProgrammingError: SQLite objects created in a thread can only be used in that same thread.The object was created in thread id -1221376320 and this is thread id -1228727440 }}}

Note: the issue happened with the builtin server, just invoked as "moin", which is supposed to be single-threaded. But to support reloading, it forks.

Comments (2)

  1. Log in to comment