[sqlalchemy] Intermittent ObjectDeletedErrors

2015-10-21 Thread Josh Jaques
Hey I'm getting some intermittent ObjectDeletedError's that I don't really understand. The code I use looks like this: > DBSession.begin() > instance = DBSession.query(OrmOjbect).get("primary_key") > DBSession.rollback() > > > x = instance.attribute1 Probably 90% of the time the

[sqlalchemy] Re: Intermittent ObjectDeletedErrors

2015-10-21 Thread Josh Jaques
Hmm well I ended up figuring out I can call DBSession.expunge(instance) to prevent the instance from trying to reload it's attributes down the road. In this case I don't need SQLA to make sure it hasn't been expired, so I'd rather just disable the SQLAlchemy state tracking for the life of the

Re: [sqlalchemy] Performance questions on semi-large result sets

2015-10-21 Thread Mike Bayer
On 10/21/15 4:52 PM, Uri Okrent wrote: > Hello, I'm trying to understand the various performance implications of > working with the ORM layer, vs the SQL language layer, vs a raw dbapi > connection. Ideally, I would like to stick with the ORM layer > > First, the set up: > CentOS 6 >

[sqlalchemy] Re: Multiple aliases not aliased correctly

2015-10-21 Thread Kristi Tsukida
ah, I see. Thanks Mike. On Wednesday, October 21, 2015 at 6:19:32 PM UTC-7, Kristi Tsukida wrote: > > It looks like only one aliased table gets aliased correctly when joining > to multiple aliased tables. > > Test case: > > from __future__ import print_function > from sqlalchemy import

Re: [sqlalchemy] Performance questions on semi-large result sets

2015-10-21 Thread Mike Bayer
On 10/21/15 7:27 PM, Uri Okrent wrote: > Interesting... > > On Wednesday, October 21, 2015 at 5:43:22 PM UTC-4, Michael Bayer wrote: > > class Customer(Base): > __tablename__ = "customer" > id = Column(Integer, primary_key=True) > name = Column(Unicode(255)) >

[sqlalchemy] Multiple aliases not aliased correctly

2015-10-21 Thread Kristi Tsukida
It looks like only one aliased table gets aliased correctly when joining to multiple aliased tables. Test case: from __future__ import print_function from sqlalchemy import Integer, String, select, Date, and_ from sqlalchemy import Column from sqlalchemy.ext.declarative import

Re: [sqlalchemy] Performance questions on semi-large result sets

2015-10-21 Thread Uri Okrent
Interesting... On Wednesday, October 21, 2015 at 5:43:22 PM UTC-4, Michael Bayer wrote: > > class Customer(Base): > __tablename__ = "customer" > id = Column(Integer, primary_key=True) > name = Column(Unicode(255)) > description = Column(Unicode(255)) > My declarative classes