[sqlalchemy] objects not necessarily pulled from session's identity map when they should (?)

2014-11-04 Thread Jonathan Vanasco
I've been going batty on this all morning. I have a permissions check routine that repeatedly queries for a certain Foo2Bar table class Foo2Bar(Base): __tablename__ = 'foo_2_bar' id_foo = Column(Integer, ForeignKey(foo.id), primary_key=True) id_bar = Column(Integer,

Re: [sqlalchemy] objects not necessarily pulled from session's identity map when they should (?)

2014-11-04 Thread Claudio Freire
On Tue, Nov 4, 2014 at 3:15 PM, Jonathan Vanasco jvana...@gmail.com wrote: I have a permissions check routine that repeatedly queries for a certain Foo2Bar table class Foo2Bar(Base): __tablename__ = 'foo_2_bar' id_foo = Column(Integer, ForeignKey(foo.id),

Re: [sqlalchemy] objects not necessarily pulled from session's identity map when they should (?)

2014-11-04 Thread Jonathan Vanasco
Thanks! I didn't realize that objects are cleaned up with scope like normal python objects. I thought they were in the session for the lifetime of the session. This was driving me crazy. This is just a web request, so I'm now appending the result into `request.persistanceArray`. instantly