thanks dan, ill try to have a look at it later.

I already know the reason its intermittent, its because the dependency
graph between your classes/tables is not correct for some reason.  if you
turn on "echo_uow=True" in your engine, youll see the dependency graphs
printed out and they should be different for the working vs. the
non-working version.

the unit of work performs a topological sort which has more than one
outcome given a particular partial ordering, i.e. theres more than one way
the ordering can be sorted.   subtle things in the python runtime
environment cause the ordering come out different, such as whether or not
a .py has a .pyc file, whether or not the code prints to the standard
output, etc.  whats really weird is how consistently those things cause
output A or B.  since the partial ordering supplied by the mappers is not
complete, sometimes the topological order happens to be what we want,
sometimes its not.

the "intermittent" nature of this particular kind of bug was hugely
frustrating for months, but at this point its a very clear symptom of
where things are breaking.




Daniel Miller wrote:
> Michael Bayer wrote:
>>
>> The only way I could have the slightest idea whats going wrong would be
>> to
>> run it (well, to see the output of the UOW dump also but thats never
>> enough)....and since I am short on time this week it would be massively
>> helpful if you could provide a complete working example of the problem,
>> since otherwise I have to resurrect such an example myself (or if anyone
>> else on the list thinks they have an idea.)
>
> No worries, I've come up with a test that fails (attached). I also
> included a very similar test that passes (this highlights one of the
> strange quirks of the bug).
>
> Note, this test only fails on a database that enforces referential
> integrity (i.e. not sqlite). However, when running it on sqlite you can
> see that the "d" row is deleted before it's parent "c" row, which should
> throw a referential integrity error.
>
> This is a very strange bug. I believe it may even be intermittent. The
> test I have attached seems to fail every single time on my machine, but
> when I added doc strings to the tests they both passed...very odd.
> However, it is encouraging to me that I was able to reproduce this bug at
> home since I originally discovered it at work with a totally different
> setup. Let me know if you need anything else.
>
> ~ Daniel
>



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to