[sqlalchemy] Advice on debugging an unexpected dirty flush update

2011-03-09 Thread Yang Zhang
I have a model with a field: class Obj(Base): ... meta = Column(PickleType) For some reason, when I do obj = session.query(Obj).get(id) obj2 = session.query(Obj2) I get a dirty UPDATE being attempted on the first object (noticed this due to read-only access to a Postgresql DB):

Re: [sqlalchemy] Advice on debugging an unexpected dirty flush update

2011-03-09 Thread Michael Bayer
On Mar 9, 2011, at 4:57 AM, Yang Zhang wrote: I have a model with a field: class Obj(Base): ... meta = Column(PickleType) For some reason, when I do obj = session.query(Obj).get(id) obj2 = session.query(Obj2) I get a dirty UPDATE being attempted on the first object

Re: [sqlalchemy] Advice on debugging an unexpected dirty flush update

2011-03-09 Thread Yang Zhang
On Wed, Mar 9, 2011 at 7:46 AM, Michael Bayer mike...@zzzcomputing.com wrote: On Mar 9, 2011, at 4:57 AM, Yang Zhang wrote: I have a model with a field: class Obj(Base):  ...  meta = Column(PickleType) For some reason, when I do  obj = session.query(Obj).get(id)  obj2 =

Re: [sqlalchemy] Advice on debugging an unexpected dirty flush update

2011-03-09 Thread Yang Zhang
On Wed, Mar 9, 2011 at 12:07 PM, Yang Zhang yanghates...@gmail.com wrote: On Wed, Mar 9, 2011 at 7:46 AM, Michael Bayer mike...@zzzcomputing.com wrote: On Mar 9, 2011, at 4:57 AM, Yang Zhang wrote: I have a model with a field: class Obj(Base):  ...  meta = Column(PickleType) For some

Re: [sqlalchemy] Advice on debugging an unexpected dirty flush update

2011-03-09 Thread Michael Bayer
On Mar 9, 2011, at 3:10 PM, Yang Zhang wrote: Also, when using mutable=False, is there a way to manually mark the field dirty, without creating a new copy of the value with a different id? 0.7 has a function flag_modified() for this purpose, which is what the mutable events extension