I find a lot of performance issues with SqlAlchemy creep into my project when database lookup happens at e.g. the template generation stage.
Is it possible to tell SqlAlchemy that 'data gathering' has finished, and that any further queries to a session (e.g. as a side effect of accessing an instrumented attribute) are to raise an exception?
What other strategies have people used to ensure that an ORM performs well?