summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2008-01-23 15:18:28 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2008-01-23 15:18:28 +0000
commita829b5c51b9246ffcf6703cd29efd7e155cd8ef3 (patch)
treefd356ec47645baaf5c48c39fe01e0f84957d137a /lib/sqlalchemy
parent74a128c6867ef67623cc9d1de3bdfdc9b064f988 (diff)
downloadsqlalchemy-a829b5c51b9246ffcf6703cd29efd7e155cd8ef3.tar.gz
more descriptive error message for m2m concurrency error
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/orm/dependency.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sqlalchemy/orm/dependency.py b/lib/sqlalchemy/orm/dependency.py
index f675aff50..fe6762056 100644
--- a/lib/sqlalchemy/orm/dependency.py
+++ b/lib/sqlalchemy/orm/dependency.py
@@ -435,13 +435,13 @@ class ManyToManyDP(DependencyProcessor):
statement = self.secondary.delete(sql.and_(*[c == sql.bindparam(c.key, type_=c.type) for c in self.secondary.c if c.key in associationrow]))
result = connection.execute(statement, secondary_delete)
if result.supports_sane_multi_rowcount() and result.rowcount != len(secondary_delete):
- raise exceptions.ConcurrentModificationError("Deleted rowcount %d does not match number of objects deleted %d" % (result.rowcount, len(secondary_delete)))
+ raise exceptions.ConcurrentModificationError("Deleted rowcount %d does not match number of secondary table rows deleted from table %s: %d" % (self.secondary.description, result.rowcount, len(secondary_delete)))
if secondary_update:
statement = self.secondary.update(sql.and_(*[c == sql.bindparam("old_" + c.key, type_=c.type) for c in self.secondary.c if c.key in associationrow]))
result = connection.execute(statement, secondary_update)
if result.supports_sane_multi_rowcount() and result.rowcount != len(secondary_update):
- raise exceptions.ConcurrentModificationError("Updated rowcount %d does not match number of objects updated %d" % (result.rowcount, len(secondary_update)))
+ raise exceptions.ConcurrentModificationError("Updated rowcount %d does not match number of secondary table rows updated from table %s: %d" % (self.secondary.description, result.rowcount, len(secondary_update)))
if secondary_insert:
statement = self.secondary.insert()