[sqlalchemy] Re: help on SAWarning

2012-03-30 Thread lars van gemerden
Found another bug and the warning is gone; can't pinpoint why though ... On Mar 30, 1:03 am, lars van gemerden l...@rational-it.com wrote: OK, thanks, I still get the warning in some cases and i am still zooming in on the problem for a small test case. At least i have solved the problem of

[sqlalchemy] Re: help on SAWarning

2012-03-29 Thread lars van gemerden
I think I have an odd case of the first possibility you mentioned: I am generating XML from SAclass objects opdating these objects from XML. To detect cyclic references and double objects, I maintain a registry of objects based on id() (reg[str(id(obj))] = obj). The id is stored as the attribute

Re: [sqlalchemy] Re: help on SAWarning

2012-03-29 Thread Michael Bayer
On Mar 29, 2012, at 6:48 AM, lars van gemerden wrote: I think I have an odd case of the first possibility you mentioned: I am generating XML from SAclass objects opdating these objects from XML. To detect cyclic references and double objects, I maintain a registry of objects based on id()

Re: [sqlalchemy] Re: help on SAWarning

2012-03-29 Thread Michael Bayer
On Mar 29, 2012, at 9:50 AM, lars van gemerden wrote: I have found that this specific behaviour (re-initialization of the InstrumentedList) does not happen if expire_on_commit = False is set on the sesssion. However this leads to other errors in my code. I guess I don't quite understand

[sqlalchemy] Re: help on SAWarning

2012-03-29 Thread lars van gemerden
OK, thanks, I still get the warning in some cases and i am still zooming in on the problem for a small test case. At least i have solved the problem of the id of InstrumentedLists changing after commit(by bypassing one layer of recursion in the xml tree parsing, i am not looking up the id of the