I've run into similar issues like this with Pyramid before, though it was usually from trying to leverage the work of previous queries into low-cost `.get()` functions onto the identity map.
The trick I settled on is to keep an array as a @reify request property, then stash objects onto it. def request_setup_persistanceArray(request): """stash items in here, so they don't get cleaned up""" return [] def includeme(config): config.add_request_method(request_setup_persistanceArray, 'persistanceArray', reify=True,) Whenever I query certain objects, I immediately do this: `request.persistanceArray.append(obj)` -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at https://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.