On Oct 27, 2007, at 3:57 AM, Robert Ian Smit wrote:

During the upgrade to the current version of Pylons (0.9.6.1) and
Beaker (0.8) db-based session and cache handling broke.

The beaker config options are passed on to the create_engine call from
sqlalchemy which raises an exception.

The db schema for sessions changed between 0.7.5 and 0.8, I'd suggest dropping the 0.7.5 beaker cache table.

For now I patched beaker.ext.database so that sa_opts is an empty dict
before doing the make_meta call:

  #if sa_opts is None:
  #    sa_opts = params
  sa_opts = {}

I am using the following pylons config:

beaker.session.namespace_class = ext:database
beaker.session.url = mysql://XXX:[EMAIL PROTECTED]/tempstorage_db
beaker.session.table_name = sessions
beaker.session.lock_dir = %(here)s/data/sessionlocks

What is the proper way to configure ext.database for use with current
pylons?

I had thought that just url should be enough, however, I apparently missed enforcing some consistency in it. So, if you're using SQLAlchemy 0.3, the .url arg is fine. However, under 0.4, all SA args, including the url, should be under sa., like so:
beaker.session.sa.url = mysql....
beaker.session.sa.pool_recycle = 30
beaker.session.sa.echo = false

So the additional prefix for SA options, is to allow multiple options to be passed to the SA connection used. Since SA 0.3 didn't have a config reader to read the options, when using 0.3, there's just the beaker.session.url option.

BTW, the 0.8 Beaker database backend is tuned for small keysets, and/ or session usage. If you're caching large amounts of arbitrary keyed data, I'd highly suggest using the memcached backend. However, you will see the db access drop significantly under Beaker 0.8.

Cheers,
Ben

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to