diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-08-01 18:24:35 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-08-01 18:24:35 -0400 |
| commit | c09b79d61eaba130efcd676db5e27ac3635535d2 (patch) | |
| tree | 689b89d21811d0fb880f0e69a5d028178a589c21 /lib/sqlalchemy/orm/dependency.py | |
| parent | 62b12e4266e5d2305f7dbc17b44bab6b2b05c622 (diff) | |
| download | sqlalchemy-c09b79d61eaba130efcd676db5e27ac3635535d2.tar.gz | |
- The name ConcurrentModificationError has been
changed to StaleDataError, and descriptive
error messages have been revised to reflect
exactly what the issue is. Both names will
remain available for the forseeable future
for schemes that may be specifying
ConcurrentModificationError in an "except:"
clause.
Diffstat (limited to 'lib/sqlalchemy/orm/dependency.py')
| -rw-r--r-- | lib/sqlalchemy/orm/dependency.py | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/lib/sqlalchemy/orm/dependency.py b/lib/sqlalchemy/orm/dependency.py index e96eed28e..376afd88d 100644 --- a/lib/sqlalchemy/orm/dependency.py +++ b/lib/sqlalchemy/orm/dependency.py @@ -1032,14 +1032,12 @@ class ManyToManyDP(DependencyProcessor): if result.supports_sane_multi_rowcount() and \ result.rowcount != len(secondary_delete): - raise exc.ConcurrentModificationError( - "Deleted rowcount %d does not match number of " - "secondary table rows deleted from table '%s': %d" % - ( - result.rowcount, - self.secondary.description, - len(secondary_delete)) - ) + raise exc.StaleDataError( + "DELETE statement on table '%s' expected to delete %d row(s); " + "Only %d were matched." % + (self.secondary.description, len(secondary_delete), + result.rowcount) + ) if secondary_update: associationrow = secondary_update[0] @@ -1051,14 +1049,12 @@ class ManyToManyDP(DependencyProcessor): result = connection.execute(statement, secondary_update) if result.supports_sane_multi_rowcount() and \ result.rowcount != len(secondary_update): - raise exc.ConcurrentModificationError( - "Updated rowcount %d does not match number of " - "secondary table rows updated from table '%s': %d" % - ( - result.rowcount, - self.secondary.description, - len(secondary_update)) - ) + raise exc.StaleDataError( + "UPDATE statement on table '%s' expected to update %d row(s); " + "Only %d were matched." % + (self.secondary.description, len(secondary_update), + result.rowcount) + ) if secondary_insert: statement = self.secondary.insert() |
