pyramid_beaker sometimes suffers SqlAlchemy error: already defined for this MetaData instance

341 Views Asked by At

I'm using beaker for my session cache in Pyramid web app, since my production environment will have multiple web servers. During development, under circumstances that cause beaker to re-initialize I get an error that beaker_cache table is already added to the meta. I'm worried that this will occur in production and I don't quite know what causes it. Has anyone else reported this problem?

Error:

Table 'beaker_cache' is already defined for this MetaData instance

I've dug into source code and see where it's happening. I've tried to specify a beaker_cache table in my ini. Here's my ini for beaker:

session.type = ext:database
session.lock_dir = ./beaker_lock
session.url = xxxx
session.auto = True
# tried to add extend existing hoping it would find it's way to the sa configuration
session.extend_existing=True
session.key = xxxx
session.secret = xxxx
session.table_name = beaker_cache
0

There are 0 best solutions below