This worked for me (using engine_from_config):
from pylons import config
from sqlalchemy import engine_from_config
from foo.model import init_model
engine = engine_from_config(config, 'sqlalchemy.')
init_model(engine)
Otherwise (using create_engine), make sure:
1) That you cast pool_recycle to an int (it won't work as a string
-- didn't for me anyway).
pool_recycle = int(app_config.get('pool_recycle', 3600))
2) If you are calling create_engine, that you pass pool_recycle as
a keyword arg.
from sqlalchemy import create_engine
engine = create_engine(url, pool_recycle=pool_recycle)
PS. grain of salt (I'm new to SQLAlchemy & pylons).
--diana
> This is my SQLAlchemy config:
>
> sqlalchemy.convert_unicode = true
> sqlalchemy.pool_size = 100
> sqlalchemy.pool_recycle = 3600
> sqlalchemy.url = mysql://user:[email protected]/database
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en.