>
>
> Are you using Session.mapper ? That's the same behavior the
> extension had in 0.4, save-on-init. I don't favor the usage of
> Session.mapper.
>
I do use Session.mapper. I recall I switched to it since I was getting
"Parent instance ... is not bound" error with sa.orm.mapper.
I hastily put my SA-updated 0.5 into production and now my inbox filled with
hundreds of errors like:
WebApp Error: <class 'sqlalchemy.exc.UnboundExecutionError'>: Instance
<CompanyPost at 0xb42606c> is not bound to a Session; attribute refresh
operation cannot proceed
and
WebApp Error: <class 'sqlalchemy.exc.ProgrammingError'>: (ProgrammingError)
(2014, "Commands out of sync; you can't run this command now")
and
WebApp Error: <class 'sqlalchemy.exc.TimeoutError'>: QueuePool limit of size
5 overflow 10 reached, connection timed out, timeout 30
I seems to have fixed the last one by adding these pool config lines to my
config.ini.
sqlalchemy.blog.pool_size = 15
sqlalchemy.blog.max_overflow = 10
Any ideas what I screwed up with the first two errors?
Here is my current setup:
from sqlalchemy.orm import scoped_session, sessionmaker
Session = scoped_session(sessionmaker())
Session.extension = Session.extension.configure(save_on_init=False)
def dbinit()
engine = engine_from_config(config, key.rstrip('url'))
session.configure(bind=engine)
meta = sqlalchemy.MetaData(engine)
metadata_cache[dbname] = meta
# используем Session mapper, а не sqlalchemy.orm.mapper
# последний дает иногда ошибку "Parent instance ... is not bound",
# http://tinyurl.com/2a76hp
callback(session.mapper, meta)
--
Max.
http://www.developers.org.ua/m/max/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" 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/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---