On 07/04/2012 16:38, Michael Bayer wrote:
On Jul 4, 2012, at 9:16 AM, Julien Cigar wrote:Hello, I have a rather strange CircularDependencyError with the following use-case: - I have a "content" table and a "data" table. - "content" is mapped with Content and "data" is mapped with File. - File is a Content (joined table inheritance), so File has a foreign key to Content (through the content_id column) - Content has foreign key too File through the icon_content_id column. I'm doing the following: foo = Content.query.get(429) Session.delete(foo) Session.commit() ... but it fails with a "CircularDependencyError: Circular dependency detected. Cycles: (..)" error (object with id 429 if a File in this case) I posted my mappers here http://pastie.org/4198679 (problematic relation is at line 136-143) and my table definition here http://pastie.org/4198678The exception message technically shows the cycles though it can be hard to read. You could have a cycle between Content.children, or perhaps interleaving File.icon/Content.icon. There's a lot of possibilities here since everything is self referential. The post_update on File.icon suggests Content.children might be involved. If there's a UOW bug you'd need to give me a minimal test case (test case here would not have most of these ancillary classes - just Content, File, a few data records, error message. Remove one thing at a time from a test case and keep running it until you isolate the minimal conditions).
I think there is an UOW bug as I removed almost everything from my mappers and I still get an error. I'll make a test case as soon as I have a little time !
-- No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
<<attachment: jcigar.vcf>>