W liście Paweł Stradomski z dnia czwartek 24 czerwca 2010:
> W liście dave z dnia czwartek 24 czerwca 2010:
> >  (...)
> >
> > We can make this problem go away one of two ways: 1) flush the cache
> > (not desirable.) 2) Issue a request to the server that does not invoke
> > the caching code. After we issue a single, quick working request,
> > subsequent requests work fine everything is happy.
> >
> > It seems to me that this is a bug. When I start the server, shouldn't
> > Pylons have SQLAlchemy fully set up? What magic is the first request
> > doing that is being missed?
> 
> I'm not sure about Pylons, but I think SQLAlchemy only compiles the mappers
> when they are first needed - eg when you load some object from db or
>  instance is created. You might try putting something like
> session.query(SomeMappedClass).first() before retrieving anything from the
> cache to check if this is it. If so, you might want to explore other ways
>  to force compiling mappers (I assume there is a function to do exactly
>  that described somewhere in the docs).
> 
sqlalchemy.orm.compile_mappers()

-- 
Paweł Stradomski

-- 
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.

Reply via email to