Storm does not use references to order flushes of deletes
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Storm |
New
|
Low
|
Unassigned |
Bug Description
Take the following Storm classes
class Foo(object):
id = Int(primary=True)
class Bar(object):
id = Int(primary=True)
foo_id = Int()
foo = Reference(foo_id, Foo.id)
Assume that we have a database level foreign key constraint to match the above definitions. When adding objects, Storm makes sure that they are flushed in the right order:
foo = Foo()
bar = Bar()
bar.foo = foo
store.add(bar)
store.flush()
But we don't do anything similar for removing objects:
store.
store.
store.flush()
If the DELETE statement to remove foo is executed before the one for bar, then we'll get an IntegrityError. The same happens if we removed foo and changed bar:
bar.foo = None
store.
store.flush()
Again, if the DELETE statement for foo is executed before the UPDATE statement for bar, we get an IntegrityError.
Changed in storm: | |
importance: | Undecided → Medium |
Changing to low importance, since Gustavo's advisory flush ordering patch reduces the chance of hitting the bug: if the deletes are done in the right order then they should be flushed in that order.